From 46d1dad0c533deb2a941156cefddc8dd286b9ab3 Mon Sep 17 00:00:00 2001 From: StriboYar Date: Thu, 19 Sep 2024 16:07:57 +0300 Subject: [PATCH] Allow use debug component with ESP32 C2 --- esphome/components/debug/debug_esp32.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/esphome/components/debug/debug_esp32.cpp b/esphome/components/debug/debug_esp32.cpp index 34aea9e26b..52773c305e 100644 --- a/esphome/components/debug/debug_esp32.cpp +++ b/esphome/components/debug/debug_esp32.cpp @@ -8,6 +8,8 @@ #if defined(USE_ESP32_VARIANT_ESP32) #include +#elif defined(USE_ESP32_VARIANT_ESP32C2) +#include #elif defined(USE_ESP32_VARIANT_ESP32C3) #include #elif defined(USE_ESP32_VARIANT_ESP32C6) @@ -57,9 +59,11 @@ std::string DebugComponent::get_reset_reason_() { case TG0WDT_SYS_RESET: reset_reason = "Timer Group 0 Watch Dog Reset Digital Core"; break; +#if !defined(USE_ESP32_VARIANT_ESP32C2) case TG1WDT_SYS_RESET: reset_reason = "Timer Group 1 Watch Dog Reset Digital Core"; break; +#endif case RTCWDT_SYS_RESET: reset_reason = "RTC Watch Dog Reset Digital Core"; break; @@ -170,6 +174,8 @@ void DebugComponent::get_device_info_(std::string &device_info) { const char *model; #if defined(USE_ESP32_VARIANT_ESP32) model = "ESP32"; +#elif defined(USE_ESP32_VARIANT_ESP32C2) + model = "ESP32-C2"; #elif defined(USE_ESP32_VARIANT_ESP32C3) model = "ESP32-C3"; #elif defined(USE_ESP32_VARIANT_ESP32C6) @@ -256,9 +262,11 @@ void DebugComponent::get_device_info_(std::string &device_info) { case UART1_TRIG: wakeup_reason = "UART1"; break; +#if !defined(USE_ESP32_VARIANT_ESP32C2) case TOUCH_TRIG: wakeup_reason = "Touch"; break; +#endif case SAR_TRIG: wakeup_reason = "SAR"; break;