diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index 4f5ed0bc9f..a44a9bd617 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -891,10 +891,12 @@ class WiFiComponent final : public Component { // Thread-safe queue for WiFi events from LibreTiny callback thread. // LockFreeQueue on platforms with hardware atomics (RTL87xx, LN882x), // FreeRTOSQueue on platforms without (BK72xx). + static constexpr uint8_t LT_EVENT_QUEUE_SIZE = 16; #ifdef ESPHOME_THREAD_MULTI_ATOMICS - LockFreeQueue event_queue_; + // Ring buffer reserves one slot, so +1 for 16 usable slots + LockFreeQueue event_queue_; #else - FreeRTOSQueue event_queue_; + FreeRTOSQueue event_queue_; #endif #endif