From e2c71419b643a4f5760358180bfab696d650ed7e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 4 Apr 2026 13:00:57 -1000 Subject: [PATCH] Revert LibreTiny ISR change: FreeRTOS port lacks vTaskNotifyGiveFromISR/portYIELD_FROM_ISR --- esphome/core/wake.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/esphome/core/wake.h b/esphome/core/wake.h index bed1d64561..ba21ebf0ee 100644 --- a/esphome/core/wake.h +++ b/esphome/core/wake.h @@ -34,15 +34,10 @@ void wake_loop_isrsafe(int *px_higher_priority_task_woken); /// IRAM_ATTR entry point — defined in wake.cpp. void wake_loop_any_context(); #else -/// LibreTiny: GPIO ISRs are real hardware interrupts, so use ISR-safe API. -/// vTaskNotifyGiveFromISR is safe from both ISR and task context on ARM Cortex-M. -inline void wake_loop_any_context() { - if (esphome_main_task_handle != NULL) { - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - vTaskNotifyGiveFromISR(esphome_main_task_handle, &xHigherPriorityTaskWoken); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - } -} +/// LibreTiny: GPIO ISRs are real hardware interrupts but the FreeRTOS port +/// may not provide vTaskNotifyGiveFromISR/portYIELD_FROM_ISR. +/// xTaskNotifyGive is used as the best available option. +inline void wake_loop_any_context() { esphome_main_task_notify(); } #endif inline void wake_loop_threadsafe() { esphome_main_task_notify(); }