Merge pull request #1 from d51x/d51x-patch-debug-esp32c2

Allow use debug component with ESP32 C2
This commit is contained in:
StriboYar 2024-09-19 16:20:57 +03:00 committed by GitHub
commit 7ca1053de1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,8 @@
#if defined(USE_ESP32_VARIANT_ESP32) #if defined(USE_ESP32_VARIANT_ESP32)
#include <esp32/rom/rtc.h> #include <esp32/rom/rtc.h>
#elif defined(USE_ESP32_VARIANT_ESP32C2)
#include <esp32c2/rom/rtc.h>
#elif defined(USE_ESP32_VARIANT_ESP32C3) #elif defined(USE_ESP32_VARIANT_ESP32C3)
#include <esp32c3/rom/rtc.h> #include <esp32c3/rom/rtc.h>
#elif defined(USE_ESP32_VARIANT_ESP32C6) #elif defined(USE_ESP32_VARIANT_ESP32C6)
@ -57,9 +59,11 @@ std::string DebugComponent::get_reset_reason_() {
case TG0WDT_SYS_RESET: case TG0WDT_SYS_RESET:
reset_reason = "Timer Group 0 Watch Dog Reset Digital Core"; reset_reason = "Timer Group 0 Watch Dog Reset Digital Core";
break; break;
#if !defined(USE_ESP32_VARIANT_ESP32C2)
case TG1WDT_SYS_RESET: case TG1WDT_SYS_RESET:
reset_reason = "Timer Group 1 Watch Dog Reset Digital Core"; reset_reason = "Timer Group 1 Watch Dog Reset Digital Core";
break; break;
#endif
case RTCWDT_SYS_RESET: case RTCWDT_SYS_RESET:
reset_reason = "RTC Watch Dog Reset Digital Core"; reset_reason = "RTC Watch Dog Reset Digital Core";
break; break;
@ -170,6 +174,8 @@ void DebugComponent::get_device_info_(std::string &device_info) {
const char *model; const char *model;
#if defined(USE_ESP32_VARIANT_ESP32) #if defined(USE_ESP32_VARIANT_ESP32)
model = "ESP32"; model = "ESP32";
#elif defined(USE_ESP32_VARIANT_ESP32C2)
model = "ESP32-C2";
#elif defined(USE_ESP32_VARIANT_ESP32C3) #elif defined(USE_ESP32_VARIANT_ESP32C3)
model = "ESP32-C3"; model = "ESP32-C3";
#elif defined(USE_ESP32_VARIANT_ESP32C6) #elif defined(USE_ESP32_VARIANT_ESP32C6)
@ -256,9 +262,11 @@ void DebugComponent::get_device_info_(std::string &device_info) {
case UART1_TRIG: case UART1_TRIG:
wakeup_reason = "UART1"; wakeup_reason = "UART1";
break; break;
#if !defined(USE_ESP32_VARIANT_ESP32C2)
case TOUCH_TRIG: case TOUCH_TRIG:
wakeup_reason = "Touch"; wakeup_reason = "Touch";
break; break;
#endif
case SAR_TRIG: case SAR_TRIG:
wakeup_reason = "SAR"; wakeup_reason = "SAR";
break; break;