From 5f3613d0e1a01e0626f6aebd4a85088d4279e125 Mon Sep 17 00:00:00 2001 From: m1nl Date: Tue, 13 May 2025 14:23:50 +0200 Subject: [PATCH] improve logging fix logging make log entry more consistent --- src/PowerFSM.cpp | 6 +++--- src/sleep.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index 904fe8362..65ac1fc0c 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -179,7 +179,7 @@ static void lsExit() powerMon->clearState(meshtastic_PowerMon_State_CPU_LightSleep); - LOG_DEBUG("Exit state: LS, slept %d ms", sleepTime); + LOG_DEBUG("Exit state: LS, stayed %d ms in light-sleep state", sleepTime); } } @@ -196,7 +196,7 @@ static void nbEnter() static void darkEnter() { - // LOG_DEBUG("State: DARK"); + // LOG_DEBUG("State: DARK"); i setBluetoothEnable(true); if (screen) screen->setOn(false); @@ -293,7 +293,7 @@ void PowerFSM_setup() #else stateIDLE = &stateDARK; #endif - LOG_INFO("PowerFSM init, USB power=%d", hasPower ? 1 : 0); + LOG_INFO("PowerFSM init, USB power=%d, is_power_saving=%d", hasPower ? 1 : 0, config.power.is_power_saving ? 1 : 0); powerFSM.add_timed_transition(&stateBOOT, hasPower ? &statePOWER : &stateON, 3 * 1000, NULL, "boot timeout"); diff --git a/src/sleep.cpp b/src/sleep.cpp index 425eef613..ac338be0b 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -480,7 +480,7 @@ void enableButtonInterrupt() pin = (gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN); #ifdef SOC_PM_SUPPORT_EXT_WAKEUP if (rtc_gpio_is_valid_gpio(pin)) { - LOG_DEBUG("Setup button pin (GPIO%02d) with wakeup by ext2 source", pin); + LOG_DEBUG("Setup button pin (GPIO%02d) with wakeup by ext1 source", pin); #ifdef BUTTON_NEED_PULLUP res = rtc_gpio_pullup_en(pin); assert(res == ESP_OK); @@ -534,7 +534,7 @@ void enableLoraInterrupt() #if SOC_PM_SUPPORT_EXT_WAKEUP if (rtc_gpio_is_valid_gpio(pin)) { - LOG_DEBUG("Setup radio interrupt (GPIO%02d) with wakeup by ext1 source", pin); + LOG_DEBUG("Setup radio interrupt (GPIO%02d) with wakeup by ext0 source", pin); res = rtc_gpio_pulldown_en((gpio_num_t)pin); assert(res == ESP_OK); res = rtc_gpio_hold_en((gpio_num_t)pin);