mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-29 04:23:54 +00:00
lwip: Fix sntp custom options if sntp_get_system_time used
This commit is contained in:
committed by
David Čermák
parent
0e956b5977
commit
bb0eecee0e
@@ -117,3 +117,18 @@ bool sntp_restart(void)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void sntp_set_system_time(uint32_t sec, uint32_t us)
|
||||
{
|
||||
struct timeval tv = { .tv_sec = sec, .tv_usec = us };
|
||||
sntp_sync_time(&tv);
|
||||
}
|
||||
|
||||
void sntp_get_system_time(uint32_t *sec, uint32_t *us)
|
||||
{
|
||||
struct timeval tv = { .tv_sec = 0, .tv_usec = 0 };
|
||||
gettimeofday(&tv, NULL);
|
||||
*(sec) = tv.tv_sec;
|
||||
*(us) = tv.tv_usec;
|
||||
sntp_set_sync_status(SNTP_SYNC_STATUS_RESET);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user