This commit is contained in:
Tomasz Duda
2026-02-11 13:18:39 +01:00
parent d1033e25fe
commit 94471be18b
2 changed files with 3 additions and 3 deletions

View File

@@ -171,7 +171,7 @@ void Logger::init_log_buffer(size_t total_buffer_size) {
this->log_buffer_ = new logger::TaskLogBuffer(total_buffer_size);
// Zephyr needs loop working to check when CDC port is open
#if defined(USE_ESP32) || defined(USE_LIBRETINY) && !(defined(USE_ZEPHYR) || defined(USE_LOGGER_USB_CDC))
#if !(defined(USE_ZEPHYR) || defined(USE_LOGGER_USB_CDC))
// Start with loop disabled when using task buffer (unless using USB CDC on ESP32)
// The loop will be enabled automatically when messages arrive
this->disable_loop_when_buffer_empty_();

View File

@@ -358,7 +358,7 @@ class Logger : public Component {
#ifdef USE_LIBRETINY
UARTSelection uart_{UART_SELECTION_DEFAULT};
#endif
#if defined(USE_ESP32) || defined(USE_HOST) || defined(USE_LIBRETINY) || USE_ZEPHYR
#if defined(USE_ESP32) || defined(USE_HOST) || defined(USE_LIBRETINY) || defined(USE_ZEPHYR)
bool main_task_recursion_guard_{false};
#ifdef USE_LIBRETINY
bool non_main_task_recursion_guard_{false}; // Shared guard for all non-main tasks on LibreTiny
@@ -462,7 +462,7 @@ class Logger : public Component {
#endif
// Zephyr needs loop working to check when CDC port is open
#if defined(USE_ESP32) || defined(USE_LIBRETINY) && !(defined(USE_ZEPHYR) || defined(USE_LOGGER_USB_CDC))
#if defined(USE_ESPHOME_TASK_LOG_BUFFER) && !(defined(USE_ZEPHYR) || defined(USE_LOGGER_USB_CDC))
// Disable loop when task buffer is empty (with USB CDC check on ESP32)
inline void disable_loop_when_buffer_empty_() {
// Thread safety note: This is safe even if another task calls enable_loop_soon_any_context()