Lines Matching full:tm

24 /* struct tm start time:   1st, Jan, 1900 */
43 static void rtc_time_to_ambiq_time_set(const struct rtc_time *tm, am_hal_rtc_time_t *atm) in rtc_time_to_ambiq_time_set() argument
46 atm->ui32Century = ((tm->tm_year <= 99) || (tm->tm_year >= 200)); in rtc_time_to_ambiq_time_set()
48 atm->ui32CenturyBit = ((tm->tm_year > 99) && (tm->tm_year < 200)); in rtc_time_to_ambiq_time_set()
50 atm->ui32Year = tm->tm_year; in rtc_time_to_ambiq_time_set()
51 if (tm->tm_year > 99) { in rtc_time_to_ambiq_time_set()
52 atm->ui32Year = tm->tm_year % 100; in rtc_time_to_ambiq_time_set()
54 atm->ui32Weekday = tm->tm_wday; in rtc_time_to_ambiq_time_set()
55 atm->ui32Month = tm->tm_mon + 1; in rtc_time_to_ambiq_time_set()
56 atm->ui32DayOfMonth = tm->tm_mday; in rtc_time_to_ambiq_time_set()
57 atm->ui32Hour = tm->tm_hour; in rtc_time_to_ambiq_time_set()
58 atm->ui32Minute = tm->tm_min; in rtc_time_to_ambiq_time_set()
59 atm->ui32Second = tm->tm_sec; in rtc_time_to_ambiq_time_set()
62 atm->ui32Hundredths = tm->tm_nsec / 10000000; in rtc_time_to_ambiq_time_set()
72 static void ambiq_time_to_rtc_time_set(const am_hal_rtc_time_t *atm, struct rtc_time *tm) in ambiq_time_to_rtc_time_set() argument
74 tm->tm_year = atm->ui32Year; in ambiq_time_to_rtc_time_set()
77 tm->tm_year += 100; in ambiq_time_to_rtc_time_set()
79 tm->tm_year += 200; in ambiq_time_to_rtc_time_set()
83 tm->tm_year += 200; in ambiq_time_to_rtc_time_set()
85 tm->tm_year += 100; in ambiq_time_to_rtc_time_set()
88 tm->tm_wday = atm->ui32Weekday; in ambiq_time_to_rtc_time_set()
89 tm->tm_mon = atm->ui32Month - 1; in ambiq_time_to_rtc_time_set()
90 tm->tm_mday = atm->ui32DayOfMonth; in ambiq_time_to_rtc_time_set()
91 tm->tm_hour = atm->ui32Hour; in ambiq_time_to_rtc_time_set()
92 tm->tm_min = atm->ui32Minute; in ambiq_time_to_rtc_time_set()
93 tm->tm_sec = atm->ui32Second; in ambiq_time_to_rtc_time_set()
96 tm->tm_nsec = atm->ui32Hundredths * 10000000; in ambiq_time_to_rtc_time_set()