Commit Graph

2 Commits

Author SHA1 Message Date
Guillaume Souchere
81fec4bf32 fix(esp_timer): process ISR-dispatch timers in alarm thread on Linux
On real hardware, ESP_TIMER_ISR callbacks run in a hardware interrupt
that preempts any FreeRTOS task. On the Linux simulator, there are no
real ISRs — the alarm is detected by a native pthread but was only
forwarded to the FreeRTOS timer_task via xTaskNotifyGive(). This meant
ISR-dispatch callbacks could be starved by higher-priority FreeRTOS
tasks, breaking components like the task watchdog that rely on
ISR-dispatch timers to detect scheduling starvation.

Move ISR-dispatch timer processing into the alarm pthread itself,
mirroring the hardware ISR path. The FreeRTOS timer_task is only
notified when no ISR-dispatch timer consumed the alarm. This is safe
because the Linux FreeRTOS port already handles vPortEnterCritical()
calls from non-FreeRTOS threads (bumps nesting counter without
blocking on scheduled-task checks).
2026-07-08 09:42:48 +02:00
Konstantin Kondrashov
f6f24af00a feat(esp_timer): Adds support Linux target 2026-06-11 11:59:25 +03:00