summaryrefslogtreecommitdiff
path: root/components/libc/compilers
diff options
context:
space:
mode:
authorliuxianliang <[email protected]>2021-03-30 10:25:00 +0800
committerliuxianliang <[email protected]>2021-03-30 10:25:00 +0800
commit6d89a9f120e2154399ca6123750dca0a78e9512d (patch)
tree4b6c623d9b5f2df6facad58823628c130f9a007b /components/libc/compilers
parentadaa45eebeaf1a772ba57bca76ef9bd04ef7fb90 (diff)
parent69c01563688855abbc7b5864ede37cde1cecba16 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into develop_one
Diffstat (limited to 'components/libc/compilers')
-rw-r--r--components/libc/compilers/common/time.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c
index 083ae9be6c..83b6ed5672 100644
--- a/components/libc/compilers/common/time.c
+++ b/components/libc/compilers/common/time.c
@@ -21,10 +21,15 @@
#include <sys/time.h>
#include <rtthread.h>
+
#ifdef RT_USING_DEVICE
#include <rtdevice.h>
#endif
+#define DBG_TAG "TIME"
+#define DBG_LVL DBG_INFO
+#include <rtdbg.h>
+
/* seconds per day */
#define SPD 24*60*60
@@ -219,6 +224,7 @@ RT_WEAK time_t time(time_t *t)
if(time_now == (time_t)-1)
{
+ LOG_W("Cannot find a RTC device to provide time!");
errno = ENOSYS;
}
@@ -246,12 +252,13 @@ int stime(const time_t *t)
}
else
{
+ LOG_W("Cannot find a RTC device to provide time!");
errno = ENOSYS;
return -1;
}
return 0;
-
#else
+ LOG_W("Cannot find a RTC device to provide time!");
errno = ENOSYS;
return -1;
#endif /* RT_USING_RTC */