From 6a388ecd6eb0d245f505572db81680c5df62c8b7 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sat, 22 Jan 2022 17:27:45 -0500 Subject: [PATCH] https://github.com/rusefi/alphax-2chan/issues/22 --- .../boards/hellen/alphax-2chan/board_configuration.cpp | 8 -------- firmware/hw_layer/ports/stm32/stm32_common.cpp | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/firmware/config/boards/hellen/alphax-2chan/board_configuration.cpp b/firmware/config/boards/hellen/alphax-2chan/board_configuration.cpp index 3e7a90b4c8..a979ea18d3 100644 --- a/firmware/config/boards/hellen/alphax-2chan/board_configuration.cpp +++ b/firmware/config/boards/hellen/alphax-2chan/board_configuration.cpp @@ -185,11 +185,3 @@ void setSdCardConfigurationOverrides() { engineConfiguration->sdCardCsPin = H_SPI2_CS; engineConfiguration->is_enabled_spi_2 = true; } - -void boardPrepareForStandby() { - PWR->CR |= PWR_CR_CWUF; //Clear Wakeup Pin flag for PA0 - PWR->CSR |= PWR_CSR_EWUP; //Enable Wakeup Pin for PA0 - - palSetPadMode(GPIOA, 0, PAL_MODE_INPUT); //Select Pin 0 on A Port - PA0, Wkup - palEnableLineEvent(PAL_LINE(GPIOA, 0), PAL_EVENT_MODE_FALLING_EDGE); // Set PA0 to interrupt on rising edge -} diff --git a/firmware/hw_layer/ports/stm32/stm32_common.cpp b/firmware/hw_layer/ports/stm32/stm32_common.cpp index 0bf9a3ce5d..8197f52a53 100644 --- a/firmware/hw_layer/ports/stm32/stm32_common.cpp +++ b/firmware/hw_layer/ports/stm32/stm32_common.cpp @@ -802,12 +802,14 @@ __attribute__((weak)) void boardPrepareForStop() { palEnableLineEvent(PAL_LINE(GPIOA, 0), PAL_EVENT_MODE_RISING_EDGE); } +/** + Standby uses special low power hardware - it always wakes on rising edge +*/ void boardPreparePA0ForStandby() { #ifdef STM32F4XX PWR->CR |= PWR_CR_CWUF; //Clear Wakeup Pin flag for PA0 PWR->CSR |= PWR_CSR_EWUP; //Enable Wakeup Pin for PA0 - // why do we not enable PAL event like in boardPrepareForStop? #endif #ifdef STM32F7XX