stm32/powerctrl: Fix build on STM32G0xx and STM32H7Bx MCUs.

STM32G0xx doesn't have DBGMCU, and STM32H7Bx doesn't have EXTI_D2.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2022-12-16 16:48:59 +11:00
parent 910f579403
commit bb77c1d5a3

View File

@ -941,9 +941,11 @@ void powerctrl_enter_standby_mode(void) {
// Clear and mask D1 EXTIs.
EXTI_D1->PR1 = 0x3fffffu;
EXTI_D1->IMR1 &= ~(0xFFFFu); // 16 lines
#if defined(EXTI_D2)
// Clear and mask D2 EXTIs.
EXTI_D2->PR1 = 0x3fffffu;
EXTI_D2->IMR1 &= ~(0xFFFFu); // 16 lines
#endif
// Clear all wake-up flags.
PWR->WKUPCR |= PWR_WAKEUP_FLAG_ALL;
#elif defined(STM32G0) || defined(STM32G4) || defined(STM32L4) || defined(STM32WB)
@ -970,7 +972,7 @@ void powerctrl_enter_standby_mode(void) {
PWR->CSR1 |= PWR_CSR1_EIWUP;
#endif
#if defined(NDEBUG)
#if defined(NDEBUG) && defined(DBGMCU)
// Disable Debug MCU.
DBGMCU->CR = 0;
#endif