1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-24 04:33:49 +01:00

Reduce web_server loop overhead on ESP32 by avoiding unnecessary semaphore operations (#9308)

This commit is contained in:
J. Nick Koston
2025-07-03 19:53:14 -05:00
committed by GitHub
parent 25457da97c
commit d00e20ccdf
2 changed files with 8 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include <deque>
#include <atomic>
#endif
#if USE_WEBSERVER_VERSION >= 2
@@ -524,6 +525,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
#ifdef USE_ESP32
std::deque<std::function<void()>> to_schedule_;
SemaphoreHandle_t to_schedule_lock_;
std::atomic<bool> to_schedule_has_items_{false};
#endif
};