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.
This commit is contained in:
Riku Isokoski authored and NeroBurner committed 2023-02-27 19:03:18 +01:00
1 parent 191bb9a59b
commit 6c0488da74
1 file changed
+1 -1
+1 -1
View File
@@ -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
}