diff options
-rw-r--r-- | boards/NONSTANDARD_STM32F4_BARTHESS1/board.h | 2 | ||||
-rw-r--r-- | os/hal/platforms/STM32/RTCv2/rtc_lld.c | 2 | ||||
-rw-r--r-- | testhal/STM32F4xx/RTC/main.c | 1 | ||||
-rw-r--r-- | testhal/STM32F4xx/RTC/mcuconf.h | 2 |
4 files changed, 5 insertions, 2 deletions
diff --git a/boards/NONSTANDARD_STM32F4_BARTHESS1/board.h b/boards/NONSTANDARD_STM32F4_BARTHESS1/board.h index c0c85dde0..3f2183e2c 100644 --- a/boards/NONSTANDARD_STM32F4_BARTHESS1/board.h +++ b/boards/NONSTANDARD_STM32F4_BARTHESS1/board.h @@ -316,7 +316,7 @@ PIN_MODE_ALTERNATE(GPIOC_SDIO_D2) | \
PIN_MODE_ALTERNATE(GPIOC_SDIO_D3) | \
PIN_MODE_ALTERNATE(GPIOC_SDIO_CK) | \
- PIN_MODE_OUTPUT(GPIOC_TAMPER_RTC) | \
+ PIN_MODE_INPUT(GPIOC_TAMPER_RTC) | \
PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
PIN_MODE_INPUT(GPIOC_OSC32_OUT))
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.c b/os/hal/platforms/STM32/RTCv2/rtc_lld.c index ca15dc1b9..171105a75 100644 --- a/os/hal/platforms/STM32/RTCv2/rtc_lld.c +++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.c @@ -186,7 +186,7 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCTime *timespec) { ;
#if STM32_RTC_HAS_SUBSECONDS
- timespec->tv_msec = (1000 * (RTCD1.id_rtc->PRER & 0x7FFF) - RTCD1.id_rtc->SSR) /
+ timespec->tv_msec = (1000 * ((RTCD1.id_rtc->PRER & 0x7FFF) - RTCD1.id_rtc->SSR)) /
((RTCD1.id_rtc->PRER & 0x7FFF) + 1);
#endif /* STM32_RTC_HAS_SUBSECONDS */
timespec->tv_time = RTCD1.id_rtc->TR;
diff --git a/testhal/STM32F4xx/RTC/main.c b/testhal/STM32F4xx/RTC/main.c index 8864e0f01..f8bd9fa85 100644 --- a/testhal/STM32F4xx/RTC/main.c +++ b/testhal/STM32F4xx/RTC/main.c @@ -54,6 +54,7 @@ static inline void exti_rtcwakeup_cb(EXTDriver *extp, expchannel_t channel){ if (RTCD1.id_rtc->ISR | RTC_ISR_WUTF){
RTCD1.id_rtc->ISR &= ~RTC_ISR_WUTF;
}
+ palTogglePad(GPIOB, GPIOB_LED_B);
palTogglePad(GPIOB, GPIOB_LED_R);
}
diff --git a/testhal/STM32F4xx/RTC/mcuconf.h b/testhal/STM32F4xx/RTC/mcuconf.h index 5bbeca57c..80f6c3866 100644 --- a/testhal/STM32F4xx/RTC/mcuconf.h +++ b/testhal/STM32F4xx/RTC/mcuconf.h @@ -37,6 +37,8 @@ */
#define STM32_NO_INIT FALSE
#define STM32_VOS STM32_VOS_HIGH
+#define STM32_PLS STM32_PLS_LEV0
+#define STM32_PVD_ENABLE TRUE
#define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED FALSE
#define STM32_HSE_ENABLED TRUE
|