Skip to content

Commit

Permalink
stm32/powerctrl: Fix build on STM32G0xx and STM32H7Bx MCUs.
Browse files Browse the repository at this point in the history
STM32G0xx doesn't have DBGMCU, and STM32H7Bx doesn't have EXTI_D2.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Dec 16, 2022
1 parent 910f579 commit bb77c1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ports/stm32/powerctrl.c
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit bb77c1d

Please sign in to comment.