mirror of https://github.com/rusefi/rusefi-1.git
IAR version of the code
This commit is contained in:
parent
f007da76df
commit
b9484413ff
|
@ -47,12 +47,17 @@ static time_t GetTimeUnixSec(void) {
|
|||
static void SetTimeUnixSec(time_t unix_time) {
|
||||
#if EFI_RTC || defined(__DOXYGEN__)
|
||||
struct tm tim;
|
||||
struct tm *canary;
|
||||
|
||||
#if defined __GNUC__
|
||||
struct tm *canary;
|
||||
/* If the conversion is successful the function returns a pointer
|
||||
to the object the result was written into.*/
|
||||
canary = localtime_r(&unix_time, &tim);
|
||||
osalDbgCheck(&tim == canary);
|
||||
#else
|
||||
struct tm *t = localtime(&tv_sec);
|
||||
memcpy(&timp, t, sizeof(struct tm));
|
||||
#endif
|
||||
|
||||
rtcConvertStructTmToDateTime(&tim, 0, ×pec);
|
||||
rtcSetTime(&RTCD1, ×pec);
|
||||
|
|
Loading…
Reference in New Issue