Part Number: LAUNCHXL-CC1310
Tool/software: TI-RTOS
I have experimented a little bit with setting the RTC and getting the time back.
Setting RTC with clock_settime() gives different results for clock_gettime() and time() :
/*
* set Clock from GPS
*/
fill_tm_from_GPS( &tmGPS )
gpsTime = mktime( &tmGPS );
gpsTimespec.tv_sec = gpsTime;
clock_settime( CLOCK_REALTIME, &gpsTimespec );
/*
* get time back
*/
clock_gettime( CLOCK_REALTIME, &rtcTimespec );
ctime( &(rtcTimespec.nv_sec) ); // result is OK : Mon May 27 06:58:44 2019
rtcTime = time(NULL);
ctime( &rtcTime ); // result is garbage : Mon Apr 20 00:30:28 1953
Alternative i have tried to det se RTC with Seconds_set( gpsTime ). The Result is the same.
If i include the 'TI-timeoffset ' (= 2208988800) in Seconds_set( gpsTime -2208988800 ) the result is reverse.
clock_gettime() gives garbage, time() gives right result.
Is this by design, or is it a bug in the libraries?
Software versions:
- CCS : 9.0.1.00004
- SDK : SimpleLink CC13x0 SDK : 3.10.0.11
- Compiler : ti-cgt-arm_18.12.2.LTS