From fffb43fa799405930434f95eb7d001aef047e0e0 Mon Sep 17 00:00:00 2001 From: Christian Baars Date: Fri, 3 May 2024 23:25:41 +0200 Subject: [PATCH] fix conflicting log_level definitions (#21337) --- lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h | 13 +++++++++++++ tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino | 7 ------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h b/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h index dda9073f3..542e3d982 100644 --- a/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h +++ b/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h @@ -38,6 +38,19 @@ # define NIMBLE_LOGC(tag, format, ...) \ NIMBLE_CPP_LOG_PRINT(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__) +// These defines pollute the global namespace and conflict with Tasmota and basically always turn on `seriallog 3` +#ifdef LOG_LEVEL_DEBUG +#undef LOG_LEVEL_DEBUG +#endif + +#ifdef LOG_LEVEL_INFO +#undef LOG_LEVEL_INFO +#endif + +#ifdef LOG_LEVEL_ERROR +#undef LOG_LEVEL_ERROR +#endif + #else // using Arduino # include "nimble/porting/nimble/include/syscfg/syscfg.h" # include "nimble/console/console.h" diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino index 057b6b926..59791ea8f 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino @@ -60,13 +60,6 @@ #define XSNS_62 62 -// undefine "trash" from the NimBLE stack, that collides with Tasmotas enum -#undef LOG_LEVEL_DEBUG -#undef LOG_LEVEL_NONE -#undef LOG_LEVEL_ERROR -#undef LOG_LEVEL_INFO -#undef LOG_LEVEL_DEBUG -#undef LOG_LEVEL_DEBUG_MORE #include #include "freertos/ringbuf.h"