| 676 | static uint8_t gRTCInit = false; |
| 677 | |
| 678 | void modGetTimeOfDay(struct modTimeVal *tv, struct modTimeZone *tz) |
| 679 | { |
| 680 | #if !ESP32 |
| 681 | if (!gRTCInit) { |
| 682 | rtctime_early_startup(); |
| 683 | rtctime_late_startup(); |
| 684 | gRTCInit = true; |
| 685 | modSetTime(819195899); |
| 686 | } |
| 687 | #endif |
| 688 | |
| 689 | if (tv) { |
| 690 | struct rtc_timeval rtc_tv; |
| 691 | |
| 692 | rtctime_gettimeofday(&rtc_tv); |
| 693 | tv->tv_sec = rtc_tv.tv_sec; |
| 694 | tv->tv_usec = rtc_tv.tv_usec; |
| 695 | } |
| 696 | |
| 697 | if (tz) { |
| 698 | tz->tz_minuteswest = gTimeZoneOffset; |
| 699 | tz->tz_dsttime = gDaylightSavings; |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | void modSetTime(uint32_t seconds) |
| 704 | { |
no test coverage detected