static void okcancel_cb(guiObject_t *obj, const void *data) { (void)obj; (void)data; RTC_SetValue(RTC_GetSerial(Rtc.value[3], Rtc.value[4], Rtc.value[5]-RTC_STARTYEAR, Rtc.value[2], Rtc.value[1], Rtc.value[0])); PAGE_SetModal(0); PAGE_RemoveAllObjects(); PAGE_ChangeByID(PAGEID_TXCFG); }
// set date (don't change time) void RTC_SetDate(u16 year, u16 month, u16 day) { RTC_SetValue(RTC_GetTimeValue(RTC_GetValue()) + _RTC_GetSerialDate((int)year, (int)month, (int)day)); }
// set time (don't change date) void RTC_SetTime(u16 hour, u16 minute, u16 second) { RTC_SetValue(RTC_GetDateValue(RTC_GetValue()) * DAYSEC + _RTC_GetSerialTime((int)hour, (int)minute, (int)second)); }
// set date (don't change time) void RTC_SetDate(uint16_t year, uint16_t month, uint16_t day) { RTC_SetValue(RTC_GetTimeValue(RTC_GetValue()) + _RTC_GetSerialDate((int)year, (int)month, (int)day)); }