From 7c4af375d84ed64e04147805f1a9f5d1d47cf573 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Tue, 7 Jun 2022 08:26:40 +0200 Subject: s/alarmAppTimer/alarmTimer/ diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp index cd011f6..fa21879 100644 --- a/src/components/alarm/AlarmController.cpp +++ b/src/components/alarm/AlarmController.cpp @@ -36,7 +36,7 @@ namespace { void AlarmController::Init(System::SystemTask* systemTask) { this->systemTask = systemTask; - alarmAppTimer = xTimerCreate("alarmAppTm", 1, pdFALSE, this, SetOffAlarm); + alarmTimer = xTimerCreate("alarmAppTm", 1, pdFALSE, this, SetOffAlarm); } void AlarmController::SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin) { @@ -48,22 +48,22 @@ void AlarmController::OnAdjustTime() { if (state != AlarmState::Set) { return; } - xTimerStop(alarmAppTimer, 0); + xTimerStop(alarmTimer, 0); auto now = dateTimeController.CurrentDateTime(); if (now > alarmTime) { - xTimerChangePeriod(alarmAppTimer, 1, 0); + xTimerChangePeriod(alarmTimer, 1, 0); } else { auto mSecToAlarm = std::chrono::duration_cast(alarmTime - now).count(); - xTimerChangePeriod(alarmAppTimer, APP_TIMER_TICKS(mSecToAlarm), 0); + xTimerChangePeriod(alarmTimer, APP_TIMER_TICKS(mSecToAlarm), 0); } - xTimerStart(alarmAppTimer, 0); + xTimerStart(alarmTimer, 0); } void AlarmController::ScheduleAlarm() { // Determine the next time the alarm needs to go off and set the timer - xTimerStop(alarmAppTimer, 0); + xTimerStop(alarmTimer, 0); auto now = dateTimeController.CurrentDateTime(); alarmTime = now; @@ -95,8 +95,8 @@ void AlarmController::ScheduleAlarm() { // now can convert back to a time_point alarmTime = std::chrono::system_clock::from_time_t(std::mktime(tmAlarmTime)); auto mSecToAlarm = std::chrono::duration_cast(alarmTime - now).count(); - xTimerChangePeriod(alarmAppTimer, APP_TIMER_TICKS(mSecToAlarm), 0); - xTimerStart(alarmAppTimer, 0); + xTimerChangePeriod(alarmTimer, APP_TIMER_TICKS(mSecToAlarm), 0); + xTimerStart(alarmTimer, 0); state = AlarmState::Set; } @@ -106,7 +106,7 @@ uint32_t AlarmController::SecondsToAlarm() { } void AlarmController::DisableAlarm() { - xTimerStop(alarmAppTimer, 0); + xTimerStop(alarmTimer, 0); state = AlarmState::Not_Set; } diff --git a/src/components/alarm/AlarmController.h b/src/components/alarm/AlarmController.h index 6ad220f..a4f0c67 100644 --- a/src/components/alarm/AlarmController.h +++ b/src/components/alarm/AlarmController.h @@ -64,7 +64,7 @@ namespace Pinetime { private: Controllers::DateTime& dateTimeController; System::SystemTask* systemTask = nullptr; - TimerHandle_t alarmAppTimer; + TimerHandle_t alarmTimer; uint8_t hours = 7; uint8_t minutes = 0; std::chrono::time_point alarmTime; -- cgit v0.10.2