Fix some conditional compilation. CONFIG_LIBC_LOCALTIME should be checked in most of the same places wehre CONFIG_TIME_EXTENDED is checked
This commit is contained in:
parent
641ca79321
commit
b1e17d8892
|
@ -902,7 +902,7 @@ int up_rtc_getdatetime(FAR struct tm *tp)
|
|||
tmp = (dr & (RTC_DR_YU_MASK | RTC_DR_YT_MASK)) >> RTC_DR_YU_SHIFT;
|
||||
tp->tm_year = rtc_bcd2bin(tmp) + 100;
|
||||
|
||||
#if defined(CONFIG_TIME_EXTENDED)
|
||||
#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
|
||||
tmp = (dr & RTC_DR_WDU_MASK) >> RTC_DR_WDU_SHIFT;
|
||||
tp->tm_wday = tmp % 7;
|
||||
tp->tm_yday = tp->tm_mday + clock_daysbeforemonth(tp->tm_mon, clock_isleapyear(tp->tm_year + 1900));
|
||||
|
@ -1014,7 +1014,7 @@ int stm32_rtc_setdatetime(FAR const struct tm *tp)
|
|||
|
||||
dr = (rtc_bin2bcd(tp->tm_mday) << RTC_DR_DU_SHIFT) |
|
||||
((rtc_bin2bcd(tp->tm_mon + 1)) << RTC_DR_MU_SHIFT) |
|
||||
#if defined(CONFIG_TIME_EXTENDED)
|
||||
#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
|
||||
((tp->tm_wday == 0 ? 7 : (tp->tm_wday & 7)) << RTC_DR_WDU_SHIFT) |
|
||||
#endif
|
||||
((rtc_bin2bcd(tp->tm_year - 100)) << RTC_DR_YU_SHIFT);
|
||||
|
|
Loading…
Reference in New Issue