Merge pull request #30 from chrismcna/master

Device wake - improve  stability
This commit is contained in:
Dirk Broßwick
2020-08-09 19:43:03 +02:00
committed by GitHub
2 changed files with 4 additions and 6 deletions

View File

@@ -25,4 +25,5 @@ lib_deps =
ESP Async WebServer@>=1.2.0
AsyncTCP@>=1.1.1
ArduinoJson@>=6.15.2
ESP32SSPD@>=1.1.0
ESP32SSPD@>=1.1.0
;monitor_filters= default, esp32_exception_decoder

View File

@@ -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 );