Fix assertion failure in ButtonHandler

FreeRTOS says zero is not a valid value for xTimerPeriodInTicks.
Zero value fires an assertion on line 361 in timers.h
This commit is contained in:
James A. Jerkins 2021-12-03 19:10:34 -06:00 committed by JF
parent cd593c3862
commit b946b8d156

View file

@ -8,7 +8,7 @@ void ButtonTimerCallback(TimerHandle_t xTimer) {
} }
void ButtonHandler::Init(Pinetime::System::SystemTask* systemTask) { void ButtonHandler::Init(Pinetime::System::SystemTask* systemTask) {
buttonTimer = xTimerCreate("buttonTimer", 0, pdFALSE, systemTask, ButtonTimerCallback); buttonTimer = xTimerCreate("buttonTimer", pdMS_TO_TICKS(200), pdFALSE, systemTask, ButtonTimerCallback);
} }
ButtonActions ButtonHandler::HandleEvent(Events event) { ButtonActions ButtonHandler::HandleEvent(Events event) {