From ce54b7949f736814331567ae4257743787d58c2f Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 21 Nov 2024 11:28:22 +0000 Subject: [PATCH] Fix non-F4 STM32 builds --- targets/stm32/jshardware.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/targets/stm32/jshardware.c b/targets/stm32/jshardware.c index 796b5dd2b..b9a6e30a6 100644 --- a/targets/stm32/jshardware.c +++ b/targets/stm32/jshardware.c @@ -68,14 +68,15 @@ unsigned short jshRTCPrescalerReciprocal; // (JSSYSTIME_SECOND << RTC_PRESCALER_ #define JSSYSTIME_EXTRA_BITS 8 // extra bits we shove on under the RTC (we try and get these from SysTick) #define JSSYSTIME_SECOND_SHIFT 20 #define JSSYSTIME_SECOND (1<CFGR1 = 0x01; -#endif +#endif // Set jump memory location for system memory - use address with 4 bytes offset which specifies jump location where program starts SysMemBootJump = (void (*)(void)) (*((uint32_t *)(bootloaderAddress + 4))); // Set main stack pointer @@ -1228,8 +1230,10 @@ void jshTurnOff() { PWR_WakeUpPinCmd(ENABLE); PWR_EnterSTANDBYMode(); } +#endif void jshInit() { +#ifdef STM32F4 /* If we turn off but the WDT is on, it'll just reset us and turn us back on. In that case we detect that (with RTC_BKP_DR0_TURN_OFF written into RTC_BKP_DR0) and turn ourselves back off quickly */ if (RTC_ReadBackupRegister(RTC_BKP_DR0)==RTC_BKP_DR0_TURN_OFF) { @@ -1246,6 +1250,7 @@ void jshInit() { RTC_WriteBackupRegister(RTC_BKP_DR0, RTC_BKP_DR0_NULL); jshJumpToDFU(); } +#endif int i; // reset some vars