reset the on chip RTC?

erimads@gmail.com
Posts: 9
Joined: Fri Jan 26, 2024 6:53 pm

reset the on chip RTC?

Postby erimads@gmail.com » Fri Feb 23, 2024 1:40 pm

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.

MicroController
Posts: 1725
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: reset the on chip RTC?

Postby MicroController » Fri Feb 23, 2024 7:31 pm

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.

Who is online

Users browsing this forum: No registered users and 397 guests