HAL_Linux: Adjust set_system_clock

Do nothing for HAL_BOARD_SUBTYPE_NONE.
This commit is contained in:
Víctor Mayoral Vilches 2015-01-21 12:00:45 +01:00 committed by Andrew Tridgell
parent 974f243c7e
commit 2b74d018fe

View File

@ -54,10 +54,12 @@ void LinuxUtil::_toneAlarm_timer_tick(){
void LinuxUtil::set_system_clock(uint64_t time_utc_usec)
{
#if CONFIG_HAL_BOARD_SUBTYPE != HAL_BOARD_SUBTYPE_NONE
timespec ts;
ts.tv_sec = time_utc_usec/1.0e6;
ts.tv_nsec = (time_utc_usec % 1000000) * 1000;
clock_settime(CLOCK_REALTIME, &ts);
#endif
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX