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:
parent
910f579403
commit
bb77c1d5a3
@ -941,9 +941,11 @@ void powerctrl_enter_standby_mode(void) {
|
|||||||
// Clear and mask D1 EXTIs.
|
// Clear and mask D1 EXTIs.
|
||||||
EXTI_D1->PR1 = 0x3fffffu;
|
EXTI_D1->PR1 = 0x3fffffu;
|
||||||
EXTI_D1->IMR1 &= ~(0xFFFFu); // 16 lines
|
EXTI_D1->IMR1 &= ~(0xFFFFu); // 16 lines
|
||||||
|
#if defined(EXTI_D2)
|
||||||
// Clear and mask D2 EXTIs.
|
// Clear and mask D2 EXTIs.
|
||||||
EXTI_D2->PR1 = 0x3fffffu;
|
EXTI_D2->PR1 = 0x3fffffu;
|
||||||
EXTI_D2->IMR1 &= ~(0xFFFFu); // 16 lines
|
EXTI_D2->IMR1 &= ~(0xFFFFu); // 16 lines
|
||||||
|
#endif
|
||||||
// Clear all wake-up flags.
|
// Clear all wake-up flags.
|
||||||
PWR->WKUPCR |= PWR_WAKEUP_FLAG_ALL;
|
PWR->WKUPCR |= PWR_WAKEUP_FLAG_ALL;
|
||||||
#elif defined(STM32G0) || defined(STM32G4) || defined(STM32L4) || defined(STM32WB)
|
#elif defined(STM32G0) || defined(STM32G4) || defined(STM32L4) || defined(STM32WB)
|
||||||
@ -970,7 +972,7 @@ void powerctrl_enter_standby_mode(void) {
|
|||||||
PWR->CSR1 |= PWR_CSR1_EIWUP;
|
PWR->CSR1 |= PWR_CSR1_EIWUP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NDEBUG)
|
#if defined(NDEBUG) && defined(DBGMCU)
|
||||||
// Disable Debug MCU.
|
// Disable Debug MCU.
|
||||||
DBGMCU->CR = 0;
|
DBGMCU->CR = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user