| 49 | static struct rtc_device_object rtc_device; |
| 50 | |
| 51 | static time_t get_rtc_timestamp(void) |
| 52 | { |
| 53 | #if defined (SOC_SERIES_AT32F435) || defined (SOC_SERIES_AT32F437) || \ |
| 54 | defined (SOC_SERIES_AT32F415) || defined (SOC_SERIES_AT32F421) || \ |
| 55 | defined (SOC_SERIES_AT32F425) || defined (SOC_SERIES_AT32F423) || \ |
| 56 | defined (SOC_SERIES_AT32F402) || defined (SOC_SERIES_AT32F405) || \ |
| 57 | defined (SOC_SERIES_AT32A423) || defined (SOC_SERIES_AT32M412) || \ |
| 58 | defined (SOC_SERIES_AT32M416) || defined (SOC_SERIES_AT32F455) || \ |
| 59 | defined (SOC_SERIES_AT32F456) || defined (SOC_SERIES_AT32F457) |
| 60 | struct tm tm_new; |
| 61 | ertc_time_type ertc_time_struct; |
| 62 | |
| 63 | ertc_calendar_get(&ertc_time_struct); |
| 64 | |
| 65 | tm_new.tm_sec = ertc_time_struct.sec; |
| 66 | tm_new.tm_min = ertc_time_struct.min; |
| 67 | tm_new.tm_hour = ertc_time_struct.hour; |
| 68 | tm_new.tm_mday = ertc_time_struct.day; |
| 69 | tm_new.tm_mon = ertc_time_struct.month - 1; |
| 70 | tm_new.tm_year = ertc_time_struct.year + 100; |
| 71 | |
| 72 | LOG_D("get rtc time."); |
| 73 | |
| 74 | return timegm(&tm_new); |
| 75 | #else |
| 76 | return rtc_counter_get(); |
| 77 | #endif |
| 78 | } |
| 79 | |
| 80 | static rt_err_t set_rtc_time_stamp(time_t time_stamp) |
| 81 | { |
no test coverage detected