diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp index 9f4e9105..d97e1cff 100644 --- a/src/components/alarm/AlarmController.cpp +++ b/src/components/alarm/AlarmController.cpp @@ -82,7 +82,7 @@ void AlarmController::ScheduleAlarm() { state = AlarmState::Set; } -uint32_t AlarmController::SecondsToAlarm() { +uint32_t AlarmController::SecondsToAlarm() const { return std::chrono::duration_cast(alarmTime - dateTimeController.CurrentDateTime()).count(); } diff --git a/src/components/alarm/AlarmController.h b/src/components/alarm/AlarmController.h index d630a128..91f60f5a 100644 --- a/src/components/alarm/AlarmController.h +++ b/src/components/alarm/AlarmController.h @@ -36,7 +36,7 @@ namespace Pinetime { void ScheduleAlarm(); void DisableAlarm(); void SetOffAlarmNow(); - uint32_t SecondsToAlarm(); + uint32_t SecondsToAlarm() const; void StopAlerting(); enum class AlarmState { Not_Set, Set, Alerting }; enum class RecurType { None, Daily, Weekdays };