timers: Fix restarting timer from a timer

Running xTimerChangePeriod and xTimerStart on the expired timer from a
callback function returns successfully, but doesn't actually set the
timer.
main
Riku Isokoski 2023-02-16 11:26:36 +07:00 committed by NeroBurner
parent 191bb9a59b
commit 6c0488da74
1 changed files with 1 additions and 1 deletions

@ -6,11 +6,11 @@ uint32_t timer_callback_wrapper(uint32_t interval, void *param) {
if (!xTimer->running) {
return 0;
}
xTimer->running = false;
xTimer->pxCallbackFunction(*xTimer);
if (xTimer->auto_reload) {
return xTimer->timer_period_in_ms;
}
xTimer->running = false;
return 0; // cancel timer
}