gettimeofday fails after esp_restart
Posted: Fri Oct 05, 2018 10:32 am
Hi everybody,
I use gettimeofday to mantain a calendar on device.
If I have a "cold power on" it reports 1st jan 1970 and I update it using settimeofday with current time/date.
When I invoke gettimeofday it reports the current date/time correctly.
Then after some time (for example 24 hours of operation) and, let's imagine the date/time is 05 oct 2018, 10:00:00, I call "esp_restart" the program restart, but gettimeofday reports a time back of about 30minutes (it is not always the same time delay), so I get 05 oct 2018, 09:35:00
Should I not consider gettimeofday result after an esp_restart reboot?
Thanks
I use gettimeofday to mantain a calendar on device.
If I have a "cold power on" it reports 1st jan 1970 and I update it using settimeofday with current time/date.
When I invoke gettimeofday it reports the current date/time correctly.
Then after some time (for example 24 hours of operation) and, let's imagine the date/time is 05 oct 2018, 10:00:00, I call "esp_restart" the program restart, but gettimeofday reports a time back of about 30minutes (it is not always the same time delay), so I get 05 oct 2018, 09:35:00
Should I not consider gettimeofday result after an esp_restart reboot?
Thanks