-
Hello,
I bought your TM4C1294,I call The RTC read-write interface you provide,The value written in is not the same as the value read out.Write the interface:HibernateCalendarSet(struct tm *psTime),Read the interface:HibernateCalendarGet(struct tm *psTime).I'm going to set 0. Theoretically it should be 1970, but it doesn't read it,How can I fix it?
Here are the renderings:
Here is my implementation of the read-write interface:
void RadarApiSetRTCTime(time_t iUtc)
{
static struct tm sTime;
static struct tm *pTime = &sTime;
ulocaltime(iUtc,pTime);
HibernateCalendarSet(pTime);
}
void RadarApiGetRTCTime(time_t *iUtc)
{
struct tm sTime;
HibernateCalendarGet(&sTime);
*iUtc= umktime(&sTime);
}