ESPHome 2026.5.0-dev
Loading...
Searching...
No Matches
main_task.h
Go to the documentation of this file.
1#pragma once
2
5
6#if defined(USE_ESP32) || defined(USE_LIBRETINY)
7
8#ifdef USE_ESP32
9#include <freertos/FreeRTOS.h>
10#include <freertos/task.h>
11#else
12#include <FreeRTOS.h>
13#include <task.h>
14#endif
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20extern TaskHandle_t esphome_main_task_handle;
21
24__attribute__((always_inline)) static inline void esphome_main_task_notify() {
25 TaskHandle_t task = esphome_main_task_handle;
26 if (task != NULL) {
27 xTaskNotifyGive(task);
28 }
29}
30
32__attribute__((always_inline)) static inline void esphome_main_task_notify_from_isr(
33 BaseType_t *px_higher_priority_task_woken) {
34 TaskHandle_t task = esphome_main_task_handle;
35 if (task != NULL) {
36 vTaskNotifyGiveFromISR(task, px_higher_priority_task_woken);
37 }
38}
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif // USE_ESP32 || USE_LIBRETINY
struct @65::@66 __attribute__
Wake the main loop task from an ISR. ISR-safe.
Definition main_task.h:32
TaskHandle_t esphome_main_task_handle
Main loop task handle and wake helpers — shared between wake.h (C++) and lwip_fast_select....
Definition main_task.c:4