diff options
| author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-07-15 08:23:19 +0000 | 
|---|---|---|
| committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-07-15 08:23:19 +0000 | 
| commit | dd2247c0995a32f37a348d9f4237e5b7f8520722 (patch) | |
| tree | 3de5e5977df48f759497a521cf646b07459a0b71 | |
| parent | 286e53490456ce99e1802539964ae72f9d4a81cc (diff) | |
| download | ChibiOS-dd2247c0995a32f37a348d9f4237e5b7f8520722.tar.gz ChibiOS-dd2247c0995a32f37a348d9f4237e5b7f8520722.tar.bz2 ChibiOS-dd2247c0995a32f37a348d9f4237e5b7f8520722.zip  | |
Fixed bug #964.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12171 110e8d01-0319-4d1e-a829-52ad28d1bb01
| -rw-r--r-- | os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c | 5 | ||||
| -rw-r--r-- | readme.txt | 2 | 
2 files changed, 5 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c index 030918c2d..502ee5b31 100644 --- a/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c +++ b/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c @@ -130,14 +130,15 @@ static void rtc_decode(uint32_t tv_sec,                         RTCDateTime *timespec) {
    struct tm tim;
    struct tm *t;
 +  const time_t time = tv_sec;	/* Copy with implicit type conversion.*/
    /* If the conversion is successful the function returns a pointer
       to the object the result was written into.*/
  #if defined(__GNUC__) || defined(__CC_ARM)
 -  t = localtime_r((time_t *)&(tv_sec), &tim);
 +  t = localtime_r(&time, &tim);
    osalDbgAssert(t != NULL, "conversion failed");
  #else
 -  t = localtime(&tv_sec);
 +  t = localtime(&time);
    memcpy(&tim, t, sizeof(struct tm));
  #endif
 diff --git a/readme.txt b/readme.txt index ae5bbe5c5..4f504905e 100644 --- a/readme.txt +++ b/readme.txt @@ -141,6 +141,8 @@  - EX:  Updated LIS302DL to 1.1.0 (backported to 18.2.1).
  - EX:  Updated LPS25H to 1.1.0 (backported to 18.2.1).
  - EX:  Updated LSM303DLHC to 1.1.0 (backported to 18.2.1).
 +- HAL: Fixed problem with STM32 RTCv1 and GCC7 compiler (bug #964)(backported
 +       to 18.2.2 and 17.6.5).
  - HAL: Fixed invalid timeout calculation in hal_buffers (bug #963)(backported
         to 18.2.2 and 17.6.5).
  - RT:  Fixed invalid parameter in CH_CFG_SYSTEM_INIT_HOOK hook macro
  | 
