You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/01/23 13:38:20 UTC
[incubator-nuttx] branch pr152 updated: remove TIME_EXTENDED option
to more conform C standard
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch pr152
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/pr152 by this push:
new 9144009 remove TIME_EXTENDED option to more conform C standard
9144009 is described below
commit 9144009e3cd84e2f164ced4f24dd0569eb2b3c1c
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Jan 23 13:24:27 2020 +0800
remove TIME_EXTENDED option to more conform C standard
Note: the code/data size increasement is small
Change-Id: I3eb45b200331f9f1af887e3f1ae0d4af3a7db560
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
Documentation/NuttxUserGuide.html | 8 --------
arch/arm/src/lpc43xx/lpc43_rtc.c | 6 ------
arch/arm/src/stm32/stm32_rtcc.c | 4 ----
arch/arm/src/stm32/stm32f40xxx_rtcc.c | 4 ----
arch/arm/src/stm32/stm32l15xxx_rtcc.c | 4 ----
arch/arm/src/stm32f7/stm32_rtc.c | 4 ----
arch/arm/src/stm32h7/stm32_rtc.c | 4 ----
arch/arm/src/stm32l4/stm32l4_rtc.c | 4 ----
arch/z80/src/ez80/Kconfig | 1 -
arch/z80/src/ez80/ez80_rtc.c | 6 ------
boards/sim/sim/sim/configs/bluetooth/defconfig | 1 -
boards/sim/sim/sim/configs/ipforward/defconfig | 1 -
boards/sim/sim/sim/configs/loadable/defconfig | 1 -
boards/sim/sim/sim/configs/minibasic/defconfig | 1 -
boards/sim/sim/sim/configs/nsh/defconfig | 1 -
boards/sim/sim/sim/configs/userfs/defconfig | 1 -
boards/z16/z16f/z16f2800100zcog/README.txt | 14 ++++++--------
drivers/timers/ds3231.c | 11 -----------
drivers/timers/mcp794xx.c | 11 -----------
drivers/timers/pcf85263.c | 11 -----------
include/nuttx/time.h | 2 --
include/nuttx/timers/rtc.h | 2 --
include/time.h | 4 ----
libs/libc/time/Kconfig | 12 ------------
libs/libc/time/Make.defs | 10 +++-------
libs/libc/time/lib_asctime.c | 4 ----
libs/libc/time/lib_asctimer.c | 4 ----
libs/libc/time/lib_ctime.c | 4 ----
libs/libc/time/lib_ctimer.c | 4 ----
libs/libc/time/lib_dayofweek.c | 3 ---
libs/libc/time/lib_gmtimer.c | 2 --
libs/libc/time/lib_strftime.c | 14 --------------
libs/libxx/Kconfig | 1 -
33 files changed, 9 insertions(+), 155 deletions(-)
diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html
index 67c5012..5c063fe 100644
--- a/Documentation/NuttxUserGuide.html
+++ b/Documentation/NuttxUserGuide.html
@@ -4359,9 +4359,7 @@ FAR struct tm *localtime(FAR const time_t *timep);
</p>
<ul><pre>
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
FAR char *asctime(FAR const struct tm *tp);
-#endif
</pre></ul>
<p>
<b>Description:</b>
@@ -4388,9 +4386,7 @@ FAR char *asctime(FAR const struct tm *tp);
</p>
<ul><pre>
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
FAR char *ctime(FAR const time_t *timep);
-#endif
</pre></ul>
<p>
<b>Description:</b>
@@ -4479,9 +4475,7 @@ FAR struct tm *localtime_r(FAR const time_t *timep, FAR struct tm *result);
</p>
<ul><pre>
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
FAR char *asctime_r(FAR const struct tm *tp, FAR char *buf);
-#endif
</pre></ul>
<p>
<b>Description:</b>
@@ -4511,9 +4505,7 @@ FAR char *asctime_r(FAR const struct tm *tp, FAR char *buf);
</p>
<ul><pre>
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
FAR char *ctime_r(FAR const time_t *timep, FAR char *buf);
-#endif
</pre></ul>
<p>
<b>Description:</b>
diff --git a/arch/arm/src/lpc43xx/lpc43_rtc.c b/arch/arm/src/lpc43xx/lpc43_rtc.c
index 7275dbb..b684204 100644
--- a/arch/arm/src/lpc43xx/lpc43_rtc.c
+++ b/arch/arm/src/lpc43xx/lpc43_rtc.c
@@ -310,11 +310,8 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp->tm_mday = ((getreg32(LPC43_RTC_DOM) & RTC_DOM_MASK));
tp->tm_mon = ((getreg32(LPC43_RTC_MONTH) & RTC_MONTH_MASK)) - 1;
tp->tm_year = ((getreg32(LPC43_RTC_YEAR) & RTC_YEAR_MASK)-1900);
-
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
tp->tm_wday = ((getreg32(LPC43_RTC_DOW) & RTC_DOW_MASK));
tp->tm_yday = ((getreg32(LPC43_RTC_DOY) & RTC_DOY_MASK));
-#endif
rtc_dumptime(tp, "Returning");
return OK;
@@ -352,11 +349,8 @@ int up_rtc_settime(FAR const struct timespec *tp)
putreg32(((newtime.tm_mday) & RTC_DOM_MASK), LPC43_RTC_DOM);
putreg32((((newtime.tm_mon)+1) & RTC_MONTH_MASK), LPC43_RTC_MONTH);
putreg32(((newtime.tm_year) & RTC_YEAR_MASK)+1900, LPC43_RTC_YEAR);
-
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
putreg32(((newtime.tm_wday) & RTC_DOW_MASK), LPC43_RTC_DOW);
putreg32(((newtime.tm_yday) & RTC_DOY_MASK), LPC43_RTC_DOY);
-#endif
return OK;
}
diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c
index 5b6db8d..0062646 100644
--- a/arch/arm/src/stm32/stm32_rtcc.c
+++ b/arch/arm/src/stm32/stm32_rtcc.c
@@ -818,12 +818,10 @@ 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_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));
tp->tm_isdst = 0;
-#endif
#ifdef CONFIG_STM32_HAVE_RTC_SUBSECONDS
/* Return RTC sub-seconds if no configured and if a non-NULL value
@@ -964,9 +962,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_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);
dr &= ~RTC_DR_RESERVED_BITS;
diff --git a/arch/arm/src/stm32/stm32f40xxx_rtcc.c b/arch/arm/src/stm32/stm32f40xxx_rtcc.c
index 8529924..d657807 100644
--- a/arch/arm/src/stm32/stm32f40xxx_rtcc.c
+++ b/arch/arm/src/stm32/stm32f40xxx_rtcc.c
@@ -1204,12 +1204,10 @@ 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_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));
tp->tm_isdst = 0;
-#endif
#ifdef CONFIG_STM32_HAVE_RTC_SUBSECONDS
/* Return RTC sub-seconds if no configured and if a non-NULL value
@@ -1318,9 +1316,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_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);
dr &= ~RTC_DR_RESERVED_BITS;
diff --git a/arch/arm/src/stm32/stm32l15xxx_rtcc.c b/arch/arm/src/stm32/stm32l15xxx_rtcc.c
index b12346b..28eb40a 100644
--- a/arch/arm/src/stm32/stm32l15xxx_rtcc.c
+++ b/arch/arm/src/stm32/stm32l15xxx_rtcc.c
@@ -1131,12 +1131,10 @@ int stm32_rtc_getdatetime_with_subseconds(FAR struct tm *tp, FAR long *nsec)
tmp = (dr & (RTC_DR_YU_MASK | RTC_DR_YT_MASK)) >> RTC_DR_YU_SHIFT;
tp->tm_year = rtc_bcd2bin(tmp) + 100;
-#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));
tp->tm_isdst = 0;
-#endif
/* Return RTC sub-seconds if a non-NULL value
* of nsec has been provided to receive the sub-second value.
@@ -1277,9 +1275,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_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);
dr &= ~RTC_DR_RESERVED_BITS;
diff --git a/arch/arm/src/stm32f7/stm32_rtc.c b/arch/arm/src/stm32f7/stm32_rtc.c
index 3ce5ffa..9f9fc38 100644
--- a/arch/arm/src/stm32f7/stm32_rtc.c
+++ b/arch/arm/src/stm32f7/stm32_rtc.c
@@ -1189,13 +1189,11 @@ 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_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));
tp->tm_isdst = 0;
-#endif
#ifdef CONFIG_STM32F7_HAVE_RTC_SUBSECONDS
/* Return RTC sub-seconds if a non-NULL value
@@ -1340,9 +1338,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_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);
dr &= ~RTC_DR_RESERVED_BITS;
diff --git a/arch/arm/src/stm32h7/stm32_rtc.c b/arch/arm/src/stm32h7/stm32_rtc.c
index 6301c91..7dcbfa4 100644
--- a/arch/arm/src/stm32h7/stm32_rtc.c
+++ b/arch/arm/src/stm32h7/stm32_rtc.c
@@ -1189,13 +1189,11 @@ 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_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));
tp->tm_isdst = 0;
-#endif
#ifdef CONFIG_STM32H7_HAVE_RTC_SUBSECONDS
/* Return RTC sub-seconds if a non-NULL value
@@ -1340,9 +1338,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_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);
dr &= ~RTC_DR_RESERVED_BITS;
diff --git a/arch/arm/src/stm32l4/stm32l4_rtc.c b/arch/arm/src/stm32l4/stm32l4_rtc.c
index 0cdf628..fdc5925 100644
--- a/arch/arm/src/stm32l4/stm32l4_rtc.c
+++ b/arch/arm/src/stm32l4/stm32l4_rtc.c
@@ -1088,12 +1088,10 @@ int stm32l4_rtc_getdatetime_with_subseconds(FAR struct tm *tp, FAR long *nsec)
tmp = (dr & (RTC_DR_YU_MASK | RTC_DR_YT_MASK)) >> RTC_DR_YU_SHIFT;
tp->tm_year = rtc_bcd2bin(tmp) + 100;
-#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));
tp->tm_isdst = 0;
-#endif
/* Return RTC sub-seconds if a non-NULL value
* of nsec has been provided to receive the sub-second value.
@@ -1234,9 +1232,7 @@ int stm32l4_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_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);
dr &= ~RTC_DR_RESERVED_BITS;
diff --git a/arch/z80/src/ez80/Kconfig b/arch/z80/src/ez80/Kconfig
index fe99f5a..ca8bb14 100644
--- a/arch/z80/src/ez80/Kconfig
+++ b/arch/z80/src/ez80/Kconfig
@@ -35,7 +35,6 @@ config EZ80_RTC
default n
select RTC
select RTC_DATETIME
- select TIME_EXTENDED
config EZ80_EMAC
bool "Ethernet MAC"
diff --git a/arch/z80/src/ez80/ez80_rtc.c b/arch/z80/src/ez80/ez80_rtc.c
index 40d1564..4243d35 100644
--- a/arch/z80/src/ez80/ez80_rtc.c
+++ b/arch/z80/src/ez80/ez80_rtc.c
@@ -198,9 +198,7 @@ static void rtc_dumptime(FAR const struct tm *tp, FAR const char *msg)
rtcinfo(" tm_sec: %08x\n", tp->tm_sec);
rtcinfo(" tm_min: %08x\n", tp->tm_min);
rtcinfo(" tm_hour: %08x\n", tp->tm_hour);
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
rtcinfo(" tm_wday: %08x\n", tp->tm_wday);
-#endif
rtcinfo(" tm_mday: %08x\n", tp->tm_mday);
rtcinfo(" tm_mon: %08x\n", tp->tm_mon);
rtcinfo(" tm_year: %08x\n", tp->tm_year);
@@ -642,9 +640,7 @@ int ez80_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
almregs.sec = alminfo->as_time.tm_sec;
almregs.min = alminfo->as_time.tm_min;
almregs.hrs = alminfo->as_time.tm_hour;
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
almregs.dow = alminfo->as_time.tm_wday;
-#endif
set_raw_alarm(&almregs);
@@ -747,9 +743,7 @@ int ez80_rtc_rdalarm(FAR struct tm *almtime)
almtime->tm_sec = almregs.sec;
almtime->tm_min = almregs.min;
almtime->tm_hour = almregs.hrs;
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
almtime->tm_wday = almregs.dow;
-#endif
rtc_dumptime((FAR const struct tm *)almtime, "Returning");
return OK;
diff --git a/boards/sim/sim/sim/configs/bluetooth/defconfig b/boards/sim/sim/sim/configs/bluetooth/defconfig
index e148c8d..54e5c9b 100644
--- a/boards/sim/sim/sim/configs/bluetooth/defconfig
+++ b/boards/sim/sim/sim/configs/bluetooth/defconfig
@@ -70,7 +70,6 @@ CONFIG_SIM_WALLTIME=y
CONFIG_START_DAY=3
CONFIG_START_MONTH=4
CONFIG_SYSTEM_NSH=y
-CONFIG_TIME_EXTENDED=y
CONFIG_USERMAIN_STACKSIZE=4096
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_WIRELESS=y
diff --git a/boards/sim/sim/sim/configs/ipforward/defconfig b/boards/sim/sim/sim/configs/ipforward/defconfig
index 408f231..70b2ca9 100644
--- a/boards/sim/sim/sim/configs/ipforward/defconfig
+++ b/boards/sim/sim/sim/configs/ipforward/defconfig
@@ -72,7 +72,6 @@ CONFIG_SIM_WALLTIME=y
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2008
CONFIG_SYSTEM_NSH=y
-CONFIG_TIME_EXTENDED=y
CONFIG_TUN_NINTERFACES=2
CONFIG_USERMAIN_STACKSIZE=4096
CONFIG_USER_ENTRYPOINT="nsh_main"
diff --git a/boards/sim/sim/sim/configs/loadable/defconfig b/boards/sim/sim/sim/configs/loadable/defconfig
index 17d59c2..a5ff865 100644
--- a/boards/sim/sim/sim/configs/loadable/defconfig
+++ b/boards/sim/sim/sim/configs/loadable/defconfig
@@ -51,6 +51,5 @@ CONFIG_SIM_WALLTIME=y
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2008
CONFIG_SYSTEM_NSH=m
-CONFIG_TIME_EXTENDED=y
CONFIG_USERMAIN_STACKSIZE=4096
CONFIG_USER_INITPATH="/system/bin/nsh"
diff --git a/boards/sim/sim/sim/configs/minibasic/defconfig b/boards/sim/sim/sim/configs/minibasic/defconfig
index bc8e3ce..856e5bd 100644
--- a/boards/sim/sim/sim/configs/minibasic/defconfig
+++ b/boards/sim/sim/sim/configs/minibasic/defconfig
@@ -56,6 +56,5 @@ CONFIG_SIM_WALLTIME=y
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2008
CONFIG_SYSTEM_NSH=y
-CONFIG_TIME_EXTENDED=y
CONFIG_USERMAIN_STACKSIZE=4096
CONFIG_USER_ENTRYPOINT="nsh_main"
diff --git a/boards/sim/sim/sim/configs/nsh/defconfig b/boards/sim/sim/sim/configs/nsh/defconfig
index 3f8e571..5cd75c8 100644
--- a/boards/sim/sim/sim/configs/nsh/defconfig
+++ b/boards/sim/sim/sim/configs/nsh/defconfig
@@ -58,6 +58,5 @@ CONFIG_SIM_WALLTIME=y
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2008
CONFIG_SYSTEM_NSH=y
-CONFIG_TIME_EXTENDED=y
CONFIG_USERMAIN_STACKSIZE=4096
CONFIG_USER_ENTRYPOINT="nsh_main"
diff --git a/boards/sim/sim/sim/configs/userfs/defconfig b/boards/sim/sim/sim/configs/userfs/defconfig
index 0e5f12c..41fc752 100644
--- a/boards/sim/sim/sim/configs/userfs/defconfig
+++ b/boards/sim/sim/sim/configs/userfs/defconfig
@@ -61,6 +61,5 @@ CONFIG_SIM_WALLTIME=y
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2008
CONFIG_SYSTEM_NSH=y
-CONFIG_TIME_EXTENDED=y
CONFIG_USERMAIN_STACKSIZE=8192
CONFIG_USER_ENTRYPOINT="nsh_main"
diff --git a/boards/z16/z16f/z16f2800100zcog/README.txt b/boards/z16/z16f/z16f2800100zcog/README.txt
index cbe9a36..22387c4 100644
--- a/boards/z16/z16f/z16f2800100zcog/README.txt
+++ b/boards/z16/z16f/z16f2800100zcog/README.txt
@@ -78,18 +78,16 @@ Version 5.2.1
This is the change to suppress building these files:
diff --git a/libs/libc/time/Make.defs b/libs/libc/time/Make.defs
- index 5c9b746778..8327e287f4 100644
+ index 2a26d556ff..08fd0b7bcd 100644
--- a/libs/libc/time/Make.defs
+++ b/libs/libc/time/Make.defs
- @@ -44,7 +44,7 @@ ifdef CONFIG_LIBC_LOCALTIME
- CSRCS += lib_localtime.c lib_asctime.c lib_asctimer.c lib_ctime.c
- CSRCS += lib_ctimer.c
+ @@ -44,7 +44,7 @@ CSRCS += lib_asctime.c lib_asctimer.c lib_ctime.c lib_ctimer.c
+ ifdef CONFIG_LIBC_LOCALTIME
+ CSRCS += lib_localtime.c
else
-CSRCS += lib_mktime.c lib_gmtime.c lib_gmtimer.c
- +CSRCS += lib_mktime.c # lib_gmtime.c lib_gmtimer.c
- ifdef CONFIG_TIME_EXTENDED
- CSRCS += lib_dayofweek.c lib_asctime.c lib_asctimer.c lib_ctime.c
- CSRCS += lib_ctimer.c
+ +CSRCS += lib_mktime.c #lib_gmtime.c lib_gmtimer.c
+ endif
The consequence is, of course, that these interfaces will not be available
to applications.
diff --git a/drivers/timers/ds3231.c b/drivers/timers/ds3231.c
index a791bce..f7b38a3 100644
--- a/drivers/timers/ds3231.c
+++ b/drivers/timers/ds3231.c
@@ -136,11 +136,9 @@ static void rtc_dumptime(FAR struct tm *tp, FAR const char *msg)
rtcinfo(" tm_mday: %08x\n", tp->tm_mday);
rtcinfo(" tm_mon: %08x\n", tp->tm_mon);
rtcinfo(" tm_year: %08x\n", tp->tm_year);
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
rtcinfo(" tm_wday: %08x\n", tp->tm_wday);
rtcinfo(" tm_yday: %08x\n", tp->tm_yday);
rtcinfo(" tm_isdst: %08x\n", tp->tm_isdst);
-#endif
}
#else
# define rtc_dumptime(tp, msg)
@@ -270,12 +268,9 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp->tm_min = 0;
tp->tm_hour = 0;
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
/* Jan 1, 1970 was a Thursday */
tp->tm_wday = 4;
-#endif
-
tp->tm_mday = 1;
tp->tm_mon = 0;
tp->tm_year = 70;
@@ -346,11 +341,9 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp->tm_hour = rtc_bcd2bin(buffer[2] & DSXXXX_TIME_HOUR24_BCDMASK);
- #if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
/* Return the day of the week (0-6) */
tp->tm_wday = (rtc_bcd2bin(buffer[3]) & DSXXXX_TIME_DAY_MASK) - 1;
-#endif
/* Return the day of the month (1-31) */
@@ -469,11 +462,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
/* Save the day of the week (1-7) */
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
buffer[4] = rtc_bin2bcd(newtm.tm_wday + 1);
-#else
- buffer[4] = 1;
-#endif
/* Save the day of the month (1-31) */
diff --git a/drivers/timers/mcp794xx.c b/drivers/timers/mcp794xx.c
index 314e0ea..87ecd4d 100644
--- a/drivers/timers/mcp794xx.c
+++ b/drivers/timers/mcp794xx.c
@@ -142,11 +142,9 @@ static void rtc_dumptime(FAR struct tm *tp, FAR const char *msg)
rtcinfo(" tm_mday: %08x\n", tp->tm_mday);
rtcinfo(" tm_mon: %08x\n", tp->tm_mon);
rtcinfo(" tm_year: %08x\n", tp->tm_year);
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
rtcinfo(" tm_wday: %08x\n", tp->tm_wday);
rtcinfo(" tm_yday: %08x\n", tp->tm_yday);
rtcinfo(" tm_isdst: %08x\n", tp->tm_isdst);
-#endif
}
#else
# define rtc_dumptime(tp, msg)
@@ -280,12 +278,9 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp->tm_min = 0;
tp->tm_hour = 0;
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
/* Jan 1, 1970 was a Thursday */
tp->tm_wday = 4;
-#endif
-
tp->tm_mday = 1;
tp->tm_mon = 0;
tp->tm_year = 70;
@@ -358,11 +353,9 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp->tm_hour = rtc_bcd2bin(buffer[2] & MCP794XX_RTCHOUR_BCDMASK);
- #if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
/* Return the day of the week (0-6) */
tp->tm_wday = (rtc_bcd2bin(buffer[3]) & MCP794XX_RTCWKDAY_BCDMASK) - 1;
-#endif
/* Return the day of the month (1-31) */
@@ -523,11 +516,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
/* Save the day of the week (1-7) and enable VBAT. */
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
buffer[4] = rtc_bin2bcd(newtm.tm_wday + 1) | MCP794XX_RTCWKDAY_VBATEN;
-#else
- buffer[4] = 1 | MCP794XX_RTCWKDAY_VBATEN;
-#endif
/* Save the day of the month (1-31) */
diff --git a/drivers/timers/pcf85263.c b/drivers/timers/pcf85263.c
index b836aaf..5345499 100644
--- a/drivers/timers/pcf85263.c
+++ b/drivers/timers/pcf85263.c
@@ -136,11 +136,9 @@ static void rtc_dumptime(FAR struct tm *tp, FAR const char *msg)
rtcinfo(" tm_mday: %08x\n", tp->tm_mday);
rtcinfo(" tm_mon: %08x\n", tp->tm_mon);
rtcinfo(" tm_year: %08x\n", tp->tm_year);
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
rtcinfo(" tm_wday: %08x\n", tp->tm_wday);
rtcinfo(" tm_yday: %08x\n", tp->tm_yday);
rtcinfo(" tm_isdst: %08x\n", tp->tm_isdst);
-#endif
}
#else
# define rtc_dumptime(tp, msg)
@@ -269,12 +267,9 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp->tm_min = 0;
tp->tm_hour = 0;
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
/* Jan 1, 1970 was a Thursday */
tp->tm_wday = 4;
-#endif
-
tp->tm_mday = 1;
tp->tm_mon = 0;
tp->tm_year = 70;
@@ -349,11 +344,9 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp->tm_mday = rtc_bcd2bin(buffer[3] & PCF85263_RTC_DAYS_MASK);
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
/* Return the day of the week (0-6) */
tp->tm_wday = (rtc_bcd2bin(buffer[4]) & PCF85263_RTC_WEEKDAYS_MASK);
-#endif
/* Return the month (0-11) */
@@ -460,11 +453,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
/* Save the day of the week (1-7) */
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
buffer[6] = rtc_bin2bcd(newtm.tm_wday);
-#else
- buffer[6] = 0;
-#endif
/* Save the month (1-12) */
diff --git a/include/nuttx/time.h b/include/nuttx/time.h
index ee4705b..d368b01 100644
--- a/include/nuttx/time.h
+++ b/include/nuttx/time.h
@@ -116,9 +116,7 @@ int clock_daysbeforemonth(int month, bool leapyear);
*
****************************************************************************/
-#if defined(CONFIG_TIME_EXTENDED)
int clock_dayoftheweek(int mday, int month, int year);
-#endif
/****************************************************************************
* Name: clock_calendar2utc
diff --git a/include/nuttx/timers/rtc.h b/include/nuttx/timers/rtc.h
index 3d0399d..8cfdb40 100644
--- a/include/nuttx/timers/rtc.h
+++ b/include/nuttx/timers/rtc.h
@@ -229,11 +229,9 @@ struct rtc_time
int tm_mday; /* Day of the month (1-31) */
int tm_mon; /* Month (0-11) */
int tm_year; /* Years since 1900 */
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
int tm_wday; /* Day of the week (0-6) (unused) */
int tm_yday; /* Day of the year (0-365) (unused) */
int tm_isdst; /* Non-0 if daylight savings time is in effect (unused) */
-#endif
#if defined(CONFIG_RTC_HIRES) || defined(CONFIG_ARCH_HAVE_RTC_SUBSECONDS)
long tm_nsec; /* Nanosecond (0-999999999) */
#endif
diff --git a/include/time.h b/include/time.h
index 8c92a3b1..87324d5 100644
--- a/include/time.h
+++ b/include/time.h
@@ -140,11 +140,9 @@ struct tm
int tm_mday; /* Day of the month (1-31) */
int tm_mon; /* Month (0-11) */
int tm_year; /* Years since 1900 */
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
int tm_wday; /* Day of the week (0-6) */
int tm_yday; /* Day of the year (0-365) */
int tm_isdst; /* Non-0 if daylight savings time is in effect */
-#endif
};
/* Struct itimerspec is used to define settings for an interval timer */
@@ -209,12 +207,10 @@ FAR struct tm *localtime_r(FAR const time_t *timep, FAR struct tm *result);
size_t strftime(FAR char *s, size_t max, FAR const char *format,
FAR const struct tm *tm);
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
FAR char *asctime(FAR const struct tm *tp);
FAR char *asctime_r(FAR const struct tm *tp, FAR char *buf);
FAR char *ctime(FAR const time_t *timep);
FAR char *ctime_r(FAR const time_t *timep, FAR char *buf);
-#endif
time_t time(FAR time_t *timep);
diff --git a/libs/libc/time/Kconfig b/libs/libc/time/Kconfig
index a05fcf0..d3be629 100644
--- a/libs/libc/time/Kconfig
+++ b/libs/libc/time/Kconfig
@@ -68,16 +68,4 @@ config LIB_ZONEINFO_ROMFS
endif # LIB_ZONEINFO
endif # LIBC_LOCALTIME
-
-config TIME_EXTENDED
- bool "Add day of week, year support"
- default "n"
- depends on !LIBC_LOCALTIME
- ---help---
- Selecting TIME_EXTENDED adds tm_wday, tm_yday and tm_isdst
- to the tm struct. This allows integration with 3rd party libraries
- that expect the tm struct to contain these members.
-
- Note: tm_isdst is always 0
-
endmenu # Time/Time Zone Support
diff --git a/libs/libc/time/Make.defs b/libs/libc/time/Make.defs
index 5c9b746..2a26d55 100644
--- a/libs/libc/time/Make.defs
+++ b/libs/libc/time/Make.defs
@@ -38,17 +38,13 @@
CSRCS += lib_strftime.c lib_calendar2utc.c lib_daysbeforemonth.c
CSRCS += lib_gettimeofday.c lib_isleapyear.c lib_settimeofday.c lib_time.c
-CSRCS += lib_nanosleep.c lib_difftime.c
+CSRCS += lib_nanosleep.c lib_difftime.c lib_dayofweek.c
+CSRCS += lib_asctime.c lib_asctimer.c lib_ctime.c lib_ctimer.c
ifdef CONFIG_LIBC_LOCALTIME
-CSRCS += lib_localtime.c lib_asctime.c lib_asctimer.c lib_ctime.c
-CSRCS += lib_ctimer.c
+CSRCS += lib_localtime.c
else
CSRCS += lib_mktime.c lib_gmtime.c lib_gmtimer.c
-ifdef CONFIG_TIME_EXTENDED
-CSRCS += lib_dayofweek.c lib_asctime.c lib_asctimer.c lib_ctime.c
-CSRCS += lib_ctimer.c
-endif
endif
# Add the time directory to the build
diff --git a/libs/libc/time/lib_asctime.c b/libs/libc/time/lib_asctime.c
index 1face37..3baf38a 100644
--- a/libs/libc/time/lib_asctime.c
+++ b/libs/libc/time/lib_asctime.c
@@ -41,8 +41,6 @@
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
-
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -69,5 +67,3 @@ FAR char *asctime(FAR const struct tm *tp)
static char buf[26];
return asctime_r(tp, buf);
}
-
-#endif /* CONFIG_LIBC_LOCALTIME || CONFIG_TIME_EXTENDED */
diff --git a/libs/libc/time/lib_asctimer.c b/libs/libc/time/lib_asctimer.c
index 6c2b3c0..9f851a7 100644
--- a/libs/libc/time/lib_asctimer.c
+++ b/libs/libc/time/lib_asctimer.c
@@ -42,8 +42,6 @@
#include <stdio.h>
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -93,5 +91,3 @@ FAR char *asctime_r(FAR const struct tm *tp, FAR char *buf)
return buf;
}
-
-#endif /* CONFIG_LIBC_LOCALTIME || CONFIG_TIME_EXTENDED */
diff --git a/libs/libc/time/lib_ctime.c b/libs/libc/time/lib_ctime.c
index e0b1500..2f7819c 100644
--- a/libs/libc/time/lib_ctime.c
+++ b/libs/libc/time/lib_ctime.c
@@ -41,8 +41,6 @@
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
-
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -78,5 +76,3 @@ FAR char *ctime(FAR const time_t *timep)
return asctime(gmtime(timep));
#endif
}
-
-#endif /* CONFIG_LIBC_LOCALTIME || CONFIG_TIME_EXTENDED */
diff --git a/libs/libc/time/lib_ctimer.c b/libs/libc/time/lib_ctimer.c
index e2ee7ea..77a07d0 100644
--- a/libs/libc/time/lib_ctimer.c
+++ b/libs/libc/time/lib_ctimer.c
@@ -41,8 +41,6 @@
#include <time.h>
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -79,5 +77,3 @@ FAR char *ctime_r(FAR const time_t *timep, FAR char *buf)
return asctime_r(gmtime_r(timep, &tm), buf);
#endif
}
-
-#endif /* CONFIG_LIBC_LOCALTIME || CONFIG_TIME_EXTENDED */
diff --git a/libs/libc/time/lib_dayofweek.c b/libs/libc/time/lib_dayofweek.c
index ceeaffc..07b64a2 100644
--- a/libs/libc/time/lib_dayofweek.c
+++ b/libs/libc/time/lib_dayofweek.c
@@ -45,8 +45,6 @@
#include <nuttx/time.h>
-#if defined(CONFIG_TIME_EXTENDED)
-
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -107,4 +105,3 @@ int clock_dayoftheweek(int mday, int month, int year)
return (mday + year + year / 4 - year / 100 + year / 400 +
(31 * month) / 12) % 7;
}
-#endif /* CONFIG_TIME_EXTENDED */
diff --git a/libs/libc/time/lib_gmtimer.c b/libs/libc/time/lib_gmtimer.c
index 6281d21..6efd9be 100644
--- a/libs/libc/time/lib_gmtimer.c
+++ b/libs/libc/time/lib_gmtimer.c
@@ -356,13 +356,11 @@ FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result)
result->tm_min = (int)min;
result->tm_sec = (int)sec;
-#if defined(CONFIG_TIME_EXTENDED)
result->tm_wday = clock_dayoftheweek(day, month, year);
result->tm_yday = day +
clock_daysbeforemonth(result->tm_mon,
clock_isleapyear(year));
result->tm_isdst = 0;
-#endif
return result;
}
diff --git a/libs/libc/time/lib_strftime.c b/libs/libc/time/lib_strftime.c
index 6fa5b5f..f8ed687 100644
--- a/libs/libc/time/lib_strftime.c
+++ b/libs/libc/time/lib_strftime.c
@@ -70,7 +70,6 @@
* Private Data
****************************************************************************/
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
static const char * const g_abbrev_wdayname[7] =
{
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
@@ -80,7 +79,6 @@ static const char * const g_wdayname[7] =
{
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
-#endif
static const char * const g_abbrev_monthname[12] =
{
@@ -181,7 +179,6 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
switch (*format++)
{
-#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
/* %a: A three-letter abbreviation for the day of the week. */
case 'a':
@@ -205,17 +202,6 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
}
}
break;
-#else
- /* %a: A three-letter abbreviation for the day of the week. */
- /* %A: The full name for the day of the week. */
-
- case 'a':
- case 'A':
- {
- len = snprintf(dest, chleft, "Day"); /* Not supported */
- }
- break;
-#endif
/* %h: Equivalent to %b */
diff --git a/libs/libxx/Kconfig b/libs/libxx/Kconfig
index c9858e9..f342066 100644
--- a/libs/libxx/Kconfig
+++ b/libs/libxx/Kconfig
@@ -44,7 +44,6 @@ config LIBCXX
select CLOCK_MONOTONIC
select LIBC_WCHAR
select LIBC_LOCALE
- select TIME_EXTENDED
---help---
If you have installed libcxx into the NuttX source tree, then it can
be built by selecting this option. See the README.txt file in the