Hi,
I can find "rtc_time_get" to get the current time, but How can I reset the rtc time? have any apis?
thanks very much!
How to set rtc time
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to set rtc time
If I recall correctly, hardware doesn't support setting the RTC time. Suggest either using the 'standard' time APIs (which will automatically use a RTC delta instead of the absolute RTC time) or calculating the difference in actual RTC time and what you want it to be yourself and subtracting that from RTC time readings.
Re: How to set rtc time
Hi,
Thanks for reply.
I find three rtc apis: get_time_since_boot/get_boot_time/set_boot_time.
if I want to set the rtc time, Can I just set boot time with "set_boot_time" api? and Getting the rtc time use "rtc_time = get_time_since_boot + get_boot_time"?
Thanks for reply.
I find three rtc apis: get_time_since_boot/get_boot_time/set_boot_time.
if I want to set the rtc time, Can I just set boot time with "set_boot_time" api? and Getting the rtc time use "rtc_time = get_time_since_boot + get_boot_time"?
Re: How to set rtc time
I think these functions are internal/static. The suggested approach is to use gettimeofday/settimeofday functions.
Who is online
Users browsing this forum: No registered users and 65 guests