ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
main_task.h File Reference

Go to the source code of this file.

Enumerations

enum  { ESPHOME_MAIN_TASK_NOTIFY_INDEX = 1 }
 ESP-IDF waits on index 0 from the main task (e.g. More...
 

Functions

 __attribute__ ((always_inline)) static inline void esphome_main_task_notify()
 Wake the main loop task from another FreeRTOS task.
 

Variables

TaskHandle_t esphome_main_task_handle
 Main loop task handle and wake helpers — shared between wake.h (C++) and lwip_fast_select.c (C).
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

ESP-IDF waits on index 0 from the main task (e.g.

pthread_join() uses an unfiltered xTaskNotifyWait), so main-loop wakes on index 0 would end those waits early.

Enumerator
ESPHOME_MAIN_TASK_NOTIFY_INDEX 

Definition at line 25 of file main_task.h.

Function Documentation

◆ __attribute__()

__attribute__ ( (always_inline) )

Wake the main loop task from another FreeRTOS task.

Block the main loop task until it is woken or the timeout expires.

Wake the main loop task from an ISR. ISR-safe.

NOT ISR-safe. always_inline so callers placed in IRAM do not reference a flash-resident copy.

Definition at line 33 of file main_task.h.

Variable Documentation

◆ esphome_main_task_handle

TaskHandle_t esphome_main_task_handle
extern

Main loop task handle and wake helpers — shared between wake.h (C++) and lwip_fast_select.c (C).

esphome_main_task_handle is set once during Application::setup() via xTaskGetCurrentTaskHandle().

Definition at line 4 of file main_task.c.