From aa9dfbf6b6b115c144748207786915d0a2ae6b62 Mon Sep 17 00:00:00 2001 From: Pawel Jalocha Date: Fri, 4 Dec 2020 21:14:03 +0000 Subject: [PATCH] Double-check for pressing the button --- main/ctrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/ctrl.cpp b/main/ctrl.cpp index 5f64b0b..0f73b87 100644 --- a/main/ctrl.cpp +++ b/main/ctrl.cpp @@ -409,8 +409,9 @@ void vTaskCTRL(void* pvParameters) // esp_sleep_enable_ext0_wakeup(PIN_AXP_IRQ, 0); // 1 = High, 0 = Low // esp_deep_sleep_start(); } - bool ShortPress = AXP.readShortPressIRQ(); - if(ShortPress) + bool ShortPress1 = AXP.readShortPressIRQ(); + bool ShortPress2 = AXP.readShortPressIRQ(); + if(ShortPress1 && ShortPress2) { KeyBuffer.Write(0x04); #ifdef DEBUG_PRINT xSemaphoreTake(CONS_Mutex, portMAX_DELAY);