summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common
diff options
context:
space:
mode:
authorguozhanxin <[email protected]>2021-03-31 13:59:58 +0800
committerguozhanxin <[email protected]>2021-03-31 14:00:09 +0800
commitd49cc6452406d70ce7a2e2acce786fbe697673b9 (patch)
treeddb998772a7915a57ab93b8b52953c99259c3696 /components/libc/compilers/common
parentf9be3c80e3631ebfc1ecc3e1f1d2df21277c0608 (diff)
parent61be3180f57bcb58a7a62acb67e3179934d500b8 (diff)
Merge remote-tracking branch 'remotes/origin/master' into add_error_check
Diffstat (limited to 'components/libc/compilers/common')
-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 */