aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/platforms/STM32/RTCv2/rtc_lld.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.c b/os/hal/platforms/STM32/RTCv2/rtc_lld.c
index 1fe433324..48a81dd96 100644
--- a/os/hal/platforms/STM32/RTCv2/rtc_lld.c
+++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.c
@@ -281,7 +281,10 @@ uint32_t rtc_lld_get_time_fat(RTCDriver *rtcp) {
uint32_t tv_date;
uint32_t v;
- rtc_lld_get_time(rtcp, &timespec);
+ chSysLock();
+ rtcGetTimeI(rtcp, &timespec);
+ chSysUnlock();
+
tv_time = timespec.tv_time;
tv_date = timespec.tv_date;