From 454467fb29f982a5982c937bef33eb19498c247e Mon Sep 17 00:00:00 2001 From: Simon Kueppers Date: Sat, 11 Mar 2023 12:38:47 +0100 Subject: [PATCH] Fixed logic bug in pre-processor clause in watchdog reset with unsupported MCU --- stm32/aioc-fw/Src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stm32/aioc-fw/Src/main.c b/stm32/aioc-fw/Src/main.c index 6197d6f..ea38733 100644 --- a/stm32/aioc-fw/Src/main.c +++ b/stm32/aioc-fw/Src/main.c @@ -79,8 +79,8 @@ static void SystemReset(void) { /* Clear reset flags */ RCC->CSR |= RCC_CSR_RMVF; -#if defined(SYSTEM_MEMORY_BASE) if (resetFlags & RCC_CSR_IWDGRSTF) { +#if defined(SYSTEM_MEMORY_BASE) /* Reset cause was watchdog, which is used for rebooting into the bootloader. Set stack pointer to *SYSTEM_MEMORY_BASE and jump to *(SYSTEM_MEMORY_BASE + 4) @@ -92,11 +92,11 @@ static void SystemReset(void) { :: [sp] "r" (*( (uint32_t*)(SYSTEM_MEMORY_BASE) )), [pc] "r" (*( (uint32_t*)(SYSTEM_MEMORY_BASE + 4) )) ); - } #else while(1) ; #endif + } /* Initialize HAL */ HAL_Init();