36 efiPrintf(
"initRtc()");
51 efiPrintf(
"Current RTC time: %02u %s %04lu %02u:%02u:%02u",
58 rtcSetTime(&RTCD1, ×pec);
66 rtcConvertDateTimeToStructTm(timespec, &tim, NULL);
72 rtcGetTime(&RTCD1, ×pec);
78 rtcGetTime(&RTCD1, ×pec);
83 uint32_t second = timespec->millisecond / 1000;
84 uint16_t minute = second / 60;
85 second -= minute * 60;
86 uint8_t hour = minute / 60;
90 .
year = timespec->year + RTC_BASE_YEAR,
91 .month = (uint8_t)timespec->month,
92 .day = (uint8_t)timespec->day,
94 .minute = (uint8_t)minute,
95 .second = (uint8_t)second,
101 RTCDateTime timespec;
102 timespec.
year = dateTime->
year - RTC_BASE_YEAR;
103 timespec.month = dateTime->
month;
104 timespec.day = dateTime->
day;
105 timespec.millisecond = (((dateTime->
hour * 60) + dateTime->
minute) * 60 + dateTime->
second) * 1000;
106 timespec.dayofweek = RTC_DAY_CATURDAY;
107 timespec.dstflag = 0;
114 static char buff[_MAX_FILLER];
118 destination[
offset] =
'0';
119 destination[
offset + 1] = buff[0];
121 destination[
offset] = buff[0];
122 destination[
offset + 1] = buff[1];
133 strcpy(destination,
"000000_000000\0");
135 if (dateTime.
year < 2016 || dateTime.
year > 2030) {
char * itoa10(char *p, int num)
static const char *const monthAbbrs[]
void PUBLIC_API_WEAK hal_lld_rtc_fixup(void)
efidatetime_t convertRtcDateTimeToEfi(RTCDateTime const *const timespec)
static time_t rtc_encode(const RTCDateTime *timespec)
void setRtcDateTime(efidatetime_t const *const dateTime)
static void putTwoSymbolDecimal(int offset, char *destination, int value)
int _gettimeofday(timeval *tv, void *tzvp)
efidatetime_t getRtcDateTime()
RTCDateTime convertRtcDateTimeFromEfi(efidatetime_t const *const dateTime)
bool dateToStringShort(char *destination)