From f33b4a714ecd4e43d9f2f27f457d1dc8bad70a29 Mon Sep 17 00:00:00 2001 From: tomaszduda23 Date: Fri, 20 Dec 2024 01:45:40 +0100 Subject: [PATCH] [esp32_ble] do not skip events if queue is blocked (#7960) --- esphome/components/esp32_ble/queue.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/esp32_ble/queue.h b/esphome/components/esp32_ble/queue.h index 5b31b97ae2..c98477e121 100644 --- a/esphome/components/esp32_ble/queue.h +++ b/esphome/components/esp32_ble/queue.h @@ -26,10 +26,10 @@ template class Queue { void push(T *element) { if (element == nullptr) return; - if (xSemaphoreTake(m_, 5L / portTICK_PERIOD_MS)) { - q_.push(element); - xSemaphoreGive(m_); - } + // It is not called from main loop. Thus it won't block main thread. + xSemaphoreTake(m_, portMAX_DELAY); + q_.push(element); + xSemaphoreGive(m_); } T *pop() {