void calendar_setdate(const UINT8 *bcd) { UINT year; year = AdjustBeforeDivision(bcd[2]); if (year < 80) { year += 100; } cal.dt.year = (UINT16)(year + 1900); cal.dt.week = (UINT8)(bcd[1] & 0x0f); cal.dt.month = (UINT8)(bcd[1] >> 4); cal.dt.day = AdjustBeforeDivision(bcd[0]); }
static void date2deg(_SYSTIME *t, const UINT8 *bcd) { UINT16 year; year = 1900 + AdjustBeforeDivision(bcd[0]); if (year < 1980) { year += 100; } t->year = (UINT16)year; t->week = (UINT16)((bcd[1]) & 0x0f); t->month = (UINT16)((bcd[1]) >> 4); t->day = (UINT16)AdjustBeforeDivision(bcd[2]); t->hour = (UINT16)AdjustBeforeDivision(bcd[3]); t->minute = (UINT16)AdjustBeforeDivision(bcd[4]); t->second = (UINT16)AdjustBeforeDivision(bcd[5]); }
void calendar_settime(const UINT8 *bcd) { cal.dt.hour = AdjustBeforeDivision(bcd[2]); cal.dt.minute = AdjustBeforeDivision(bcd[1]); cal.dt.second = AdjustBeforeDivision(bcd[0]); }