From b1e17d88924f87316cb65ed65768481623e1de9c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 25 Nov 2015 12:51:07 -0600 Subject: [PATCH] Fix some conditional compilation. CONFIG_LIBC_LOCALTIME should be checked in most of the same places wehre CONFIG_TIME_EXTENDED is checked --- arch/arm/src/stm32/stm32_rtcc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c index 37aca70c51..35020c8430 100644 --- a/arch/arm/src/stm32/stm32_rtcc.c +++ b/arch/arm/src/stm32/stm32_rtcc.c @@ -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);