From 2074447120ec99bde0a09282ae771d8d8843e4aa Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 3 Jan 2026 10:48:24 -1000 Subject: [PATCH] tune --- esphome/components/wifi/wifi_component_libretiny.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/wifi/wifi_component_libretiny.cpp b/esphome/components/wifi/wifi_component_libretiny.cpp index 137a9c71a7..75ac5bfab7 100644 --- a/esphome/components/wifi/wifi_component_libretiny.cpp +++ b/esphome/components/wifi/wifi_component_libretiny.cpp @@ -36,7 +36,8 @@ static const char *const TAG = "wifi_lt"; // This is the same approach used by ESP32 IDF's wifi_process_event_(). // All state modifications happen in the main loop context, eliminating races. -static QueueHandle_t s_event_queue = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) +static constexpr size_t EVENT_QUEUE_SIZE = 16; // Max pending WiFi events before overflow +static QueueHandle_t s_event_queue = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) static volatile uint32_t s_event_queue_overflow_count = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) @@ -593,7 +594,7 @@ void WiFiComponent::wifi_process_event_(LTWiFiEvent *event) { void WiFiComponent::wifi_pre_setup_() { // Create event queue for thread-safe event handling // Events are pushed from WiFi callback thread and processed in main loop - s_event_queue = xQueueCreate(16, sizeof(LTWiFiEvent *)); + s_event_queue = xQueueCreate(EVENT_QUEUE_SIZE, sizeof(LTWiFiEvent *)); if (s_event_queue == nullptr) { ESP_LOGE(TAG, "Failed to create event queue"); return;