| 25 | static struct rtc_device_object rtc_device; |
| 26 | |
| 27 | static rt_err_t pico_rtc_get_timeval(struct timeval *tv) |
| 28 | { |
| 29 | datetime_t t; |
| 30 | struct tm tm_new = {0}; |
| 31 | rtc_get_datetime(&t); |
| 32 | |
| 33 | tm_new.tm_sec = t.sec; |
| 34 | tm_new.tm_min = t.min; |
| 35 | tm_new.tm_hour = t.hour; |
| 36 | tm_new.tm_wday = t.dotw; |
| 37 | tm_new.tm_mday = t.day; |
| 38 | tm_new.tm_mon = t.month - 1; |
| 39 | tm_new.tm_year = t.year - 1900; |
| 40 | |
| 41 | tv->tv_sec = timegm(&tm_new); |
| 42 | |
| 43 | return RT_EOK; |
| 44 | } |
| 45 | |
| 46 | static rt_err_t pico_rtc_init(void) |
| 47 | { |
no test coverage detected