diff options
-rw-r--r-- | os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c index 13b2cf9b9..16cb9b500 100644 --- a/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c +++ b/os/hal/ports/STM32/LLD/RTCv1/rtc_lld.c @@ -133,12 +133,12 @@ static void rtc_decode(uint32_t tv_sec, /* If the conversion is successful the function returns a pointer
to the object the result was written into.*/
-#if defined __GNUC__
+#if defined(__GNUC__) || defined(__CC_ARM)
t = localtime_r((time_t *)&(tv_sec), &tim);
osalDbgAssert(t != NULL, "conversion failed");
#else
struct tm *t = localtime(&tv_sec);
- memcpy(&timp, t, sizeof(struct tm));
+ memcpy(&tim, t, sizeof(struct tm));
#endif
rtcConvertStructTmToDateTime(&tim, tv_msec, timespec);
|