mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
add rtc_time implementation for native
This commit is contained in:
parent
634a784cd2
commit
945aefad4f
@ -68,3 +68,17 @@ void rtc_get_localtime(struct tm *localt)
|
||||
_native_in_syscall--;
|
||||
}
|
||||
}
|
||||
|
||||
time_t rtc_time(struct timeval *time)
|
||||
{
|
||||
if (native_rtc_enabled == 1) {
|
||||
_native_in_syscall++;
|
||||
if (gettimeofday(time, 0) == 0) {
|
||||
errx(1, "rtc_time: gettimeofday: error");
|
||||
}
|
||||
_native_in_syscall--;
|
||||
}
|
||||
return time->tv_sec;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user