Page 1 of 1

reset the on chip RTC?

Posted: Fri Feb 23, 2024 1:40 pm
by erimads@gmail.com
Hello
Is it in anyway possible to reset the internal RTC or write to RTC's registre?
I need to do this to make shore I get the newest when calling localtime_r after calling sntp_init.

Re: reset the on chip RTC?

Posted: Fri Feb 23, 2024 7:31 pm
by MicroController
You can set esp_sntp_config::sync_cb to be notified when a time from the network becomes available. Prior to the SNTP sync finishing, fiddling with the RTC is of no use. And if you use SNTP_SYNC_MODE_IMMED, fiddling with the RTC after the sync is of no use either.