Replaced all 1900 with TM_YEAR_BASE

This commit is contained in:
Damjan Adamic
2016-10-30 11:35:12 +01:00
parent 6378c97b33
commit 37ea272bd4
15 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ extern "C" void TWI0_IRQHandler()
utm.tm_hour = Co_proc_status[3] ;
utm.tm_mday = Co_proc_status[4] ;
utm.tm_mon = Co_proc_status[5] - 1;
utm.tm_year = (Co_proc_status[6] + ( Co_proc_status[7] << 8 )) - 1900;
utm.tm_year = (Co_proc_status[6] + ( Co_proc_status[7] << 8 )) - TM_YEAR_BASE;
g_rtcTime = gmktime(&utm);
}
Coproc_temp = Co_proc_status[8];
+2 -2
View File
@@ -246,8 +246,8 @@ void rtcSetTime(const struct gtm * t)
I2CTime.Time[2] = t->tm_hour ;
I2CTime.Time[3] = t->tm_mday ;
I2CTime.Time[4] = t->tm_mon+1 ;
I2CTime.Time[5] = (uint8_t) (t->tm_year+1900);
I2CTime.Time[6] = (t->tm_year+1900) >> 8;
I2CTime.Time[5] = (uint8_t) (t->tm_year+TM_YEAR_BASE);
I2CTime.Time[6] = (t->tm_year+TM_YEAR_BASE) >> 8;
#if defined(REVX)
writeRTC((uint8_t *)&I2CTime.Time[0]) ;
#elif defined(COPROCESSOR)