AlarmController: add const to SecondsToAlarm() function

The function `SecondsToAlarm()` doesn't change anything in the
`AlarmController` object. Mark the function `const` to show this
property.
This commit is contained in:
Reinhold Gschweicher 2022-09-26 21:39:41 +02:00 committed by JF
parent 30e8353a4f
commit f699261ca3
2 changed files with 2 additions and 2 deletions

View file

@ -82,7 +82,7 @@ void AlarmController::ScheduleAlarm() {
state = AlarmState::Set;
}
uint32_t AlarmController::SecondsToAlarm() {
uint32_t AlarmController::SecondsToAlarm() const {
return std::chrono::duration_cast<std::chrono::seconds>(alarmTime - dateTimeController.CurrentDateTime()).count();
}

View file

@ -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 };