rusefillc 2022-01-22 17:27:45 -05:00
parent 7e1a1a3ba8
commit 6a388ecd6e
2 changed files with 3 additions and 9 deletions

View File

@ -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
}

View File

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