mirror of
https://github.com/espressif/esp-idf.git
synced 2026-07-17 16:33:02 +03:00
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).