summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-06-06 22:32:23 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-06-10 09:22:17 (GMT)
commitede8cb64d51025aad616622aebeb4144bbcdc786 (patch)
tree8f02285d8384fa30102d31086b5c21d190230da1
parentd8874bd03522c34a3c38f5b8b1756999f8a2908b (diff)
Make sure duration parameter is not zero
-rw-r--r--src/components/alarm/AlarmController.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp
index 94914bd..e6e26fe 100644
--- a/src/components/alarm/AlarmController.cpp
+++ b/src/components/alarm/AlarmController.cpp
@@ -100,7 +100,7 @@ void AlarmController::ScheduleAlarm() {
// now can convert back to a time_point
alarmTime = std::chrono::system_clock::from_time_t(std::mktime(tmAlarmTime));
auto ticksToAlarm = std::chrono::duration_cast<ticks_t>(alarmTime - now).count();
- xTimerChangePeriod(alarmTimer, ticksToAlarm, 0);
+ xTimerChangePeriod(alarmTimer, ++ticksToAlarm, 0);
xTimerStart(alarmTimer, 0);
state = AlarmState::Set;