diff options
| author | Meco Man <[email protected]> | 2021-02-07 21:08:41 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-02-07 21:08:41 +0800 |
| commit | f073911cd32bf8bfd02d6945db230e5e7b9b75ea (patch) | |
| tree | dcc48ceaf009960e89defb3ce712dc7feccec4a9 /bsp/apollo2 | |
| parent | 852d7d7552bd3fe898115ea16ba401970b0d1fad (diff) | |
解决底层驱动格林威治时间与当地时间胡乱使用的问题 mktime函数改为timegm函数
Diffstat (limited to 'bsp/apollo2')
| -rw-r--r-- | bsp/apollo2/board/rtc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bsp/apollo2/board/rtc.c b/bsp/apollo2/board/rtc.c index 1bc4779257..3d2e1c8e7a 100644 --- a/bsp/apollo2/board/rtc.c +++ b/bsp/apollo2/board/rtc.c @@ -25,6 +25,7 @@ #include <rtthread.h> #include <rtdevice.h> #include "am_mcu_apollo.h" +#include <sys/time.h> #define XT 1 #define LFRC 2 @@ -78,7 +79,7 @@ static rt_err_t rt_rtc_control(rt_device_t dev, int cmd, void *args) /* Seconds 0-59 : the 0-59 range */ time_temp.tm_sec = hal_time.ui32Second; - *time = mktime(&time_temp); + *time = timegm(&time_temp); break; |
