8000 stm32/powerctrl: Fix build on STM32G0xx and STM32H7Bx MCUs. · micropython/micropython@bb77c1d · GitHub
[go: up one dir, main page]

Skip to content
< 65E2 script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-e789af5a4655.js">

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)
0