mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-24 05:04:10 +08:00
[simulator] 修复 linux simulator 编译运行失败
This commit is contained in:
committed by
Man, Jianting (Meco)
parent
0a7b08d00a
commit
22972409d4
@@ -42,6 +42,7 @@ static void soft_rtc_alarm_update(struct rt_rtc_wkalarm *palarm)
|
||||
|
||||
static void get_rtc_timeval(struct timeval *tv)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
struct tm newtime = { 0 };
|
||||
SYSTEMTIME sys_time;
|
||||
|
||||
@@ -56,6 +57,10 @@ static void get_rtc_timeval(struct timeval *tv)
|
||||
|
||||
tv->tv_sec = timegm(&newtime);
|
||||
tv->tv_usec = sys_time.wMilliseconds * 1000UL;
|
||||
#else
|
||||
tv->tv_sec = 0;
|
||||
tv->tv_usec = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static rt_err_t pc_rtc_control(rt_device_t dev, int cmd, void *args)
|
||||
|
||||
Reference in New Issue
Block a user