From 64a8af64ed4e6bf7006ff21ca72e670403c413e7 Mon Sep 17 00:00:00 2001 From: chrismcna Date: Sun, 9 Aug 2020 16:17:02 +0100 Subject: [PATCH 1/2] Added esp32 exception decoder - Commented out --- platformio.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 18e12b5..7b50617 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,4 +25,5 @@ lib_deps = ESP Async WebServer@>=1.2.0 AsyncTCP@>=1.1.1 ArduinoJson@>=6.15.2 - ESP32SSPD@>=1.1.0 \ No newline at end of file + ESP32SSPD@>=1.1.0 +;monitor_filters= default, esp32_exception_decoder \ No newline at end of file From f3a140f8568623ca9f3e07f8e319af2b501d09c5 Mon Sep 17 00:00:00 2001 From: chrismcna Date: Sun, 9 Aug 2020 16:30:47 +0100 Subject: [PATCH 2/2] Moved setCpuFrequencyMhz from interrupt to event handling Calling setCpuFrequencyMhz in the interrupt sometimes causes watchdog time expection --- src/hardware/pmu.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/hardware/pmu.cpp b/src/hardware/pmu.cpp index 4d510fd..9cd9982 100644 --- a/src/hardware/pmu.cpp +++ b/src/hardware/pmu.cpp @@ -63,11 +63,6 @@ void IRAM_ATTR pmu_irq( void ) { if ( xHigherPriorityTaskWoken ) { portYIELD_FROM_ISR(); } - /* - * fast wake up from IRQ - */ - // rtc_clk_cpu_freq_set(RTC_CPU_FREQ_240M); - setCpuFrequencyMhz(240); } void pmu_standby( void ) { @@ -175,6 +170,8 @@ void pmu_loop( TTGOClass *ttgo ) { * handle IRQ event */ if ( xEventGroupGetBitsFromISR( pmu_event_handle ) & PMU_EVENT_AXP_INT ) { + setCpuFrequencyMhz(240); + ttgo->power->readIRQ(); if (ttgo->power->isVbusPlugInIRQ()) { powermgm_set_event( POWERMGM_PMU_BATTERY );