Removed call to localtime_r() function for non-GNU compilers.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8056 35acf78f-673a-0410-8e92-d51de3d6d3f4master
parent
90527794f0
commit
d2fb55a6bc
|
@ -125,15 +125,21 @@ static time_t rtc_encode(const RTCDateTime *timespec) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
static void rtc_decode(uint32_t tv_sec, uint32_t tv_msec,
|
||||
RTCDateTime *timespec) {
|
||||
static void rtc_decode(uint32_t tv_sec,
|
||||
uint32_t tv_msec,
|
||||
RTCDateTime *timespec) {
|
||||
struct tm tim;
|
||||
struct tm *canary;
|
||||
struct tm *t;
|
||||
|
||||
/* If the conversion is successful the function returns a pointer
|
||||
to the object the result was written into.*/
|
||||
canary = localtime_r((time_t *)&(tv_sec), &tim);
|
||||
osalDbgCheck(&tim == canary);
|
||||
#if defined __GNUC__
|
||||
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));
|
||||
#endif
|
||||
|
||||
rtcConvertStructTmToDateTime(&tim, tv_msec, timespec);
|
||||
}
|
||||
|
|
|
@ -74,6 +74,8 @@
|
|||
*****************************************************************************
|
||||
|
||||
*** 3.0.0p6 ***
|
||||
- HAL: Removed call to localtime_r() function for non-GNU compilers in
|
||||
STM32F1xx RTC driver.
|
||||
- DEM: Fixed the FatFS demo timeout, now it is expressed in milliseconds.
|
||||
- DEM: Added -Wundef to all the demos and test programs in order to find
|
||||
common error cases.
|
||||
|
|
Loading…
Reference in New Issue