Beispiel #1
0
// get serial time (seconds since 01.01.RTC_STARTYEAR (now 2012), 0:00:00 - "deviation epoch")    //year = RTC_STARTYEAR-based
u32 RTC_GetSerial(int year, int month, int day, int hour, int minute, int second)
{
    return _RTC_GetSerialTime(hour, minute, second) + _RTC_GetSerialDate(year, month, day);
}
Beispiel #2
0
// 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));
}
Beispiel #3
0
// 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));
}