Skip to content

Commit bb77c1d

Browse files
committed
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>
1 parent 910f579 commit bb77c1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ports/stm32/powerctrl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,9 +941,11 @@ void powerctrl_enter_standby_mode(void) {
941941
// Clear and mask D1 EXTIs.
942942
EXTI_D1->PR1 = 0x3fffffu;
943943
EXTI_D1->IMR1 &= ~(0xFFFFu); // 16 lines
944+
#if defined(EXTI_D2)
944945
// Clear and mask D2 EXTIs.
945946
EXTI_D2->PR1 = 0x3fffffu;
946947
EXTI_D2->IMR1 &= ~(0xFFFFu); // 16 lines
948+
#endif
947949
// Clear all wake-up flags.
948950
PWR->WKUPCR |= PWR_WAKEUP_FLAG_ALL;
949951
#elif defined(STM32G0) || defined(STM32G4) || defined(STM32L4) || defined(STM32WB)
@@ -970,7 +972,7 @@ void powerctrl_enter_standby_mode(void) {
970972
PWR->CSR1 |= PWR_CSR1_EIWUP;
971973
#endif
972974

973-
#if defined(NDEBUG)
975+
#if defined(NDEBUG) && defined(DBGMCU)
974976
// Disable Debug MCU.
975977
DBGMCU->CR = 0;
976978
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy