-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[draft] Don't reset the RTC time from gettimeofday(), plus other RTC cleanups #210
[draft] Don't reset the RTC time from gettimeofday(), plus other RTC cleanups #210
Conversation
What would be the action to make time(NULL) working without calling rtc_init() first? It seems logical for me that RTC module is initialized when it's used and available and that you just can use the time(NULL) example as presented in the documention. Related to that, why you can use RTC at 4 different levels? As RTC object, RTC api, RTC HAL and default C-lib functions? |
From my understanding
After this PR the BR, Jan |
Is this for all functionality the same? It's strange that they use a mix in the mbed documentation. For instance for SPI they use the C++ way of instantiating objects. |
I will try this solution but I'm struggeling with (never used gh before):
|
I think yes and it is cool because Mbed can not cover every posibility and then you can combine Mbed APIs with brand specific HALs or make your own API based on Mbed HALs. |
Why this merge is blocked? |
Huh, that is weird. I am able to merge... |
Oops looks like I forgot to remove "[draft]" from the title... oh well |
Summary of changes
This is a fix for the RTC issues that @sunnydaywest reported on the forums, and also as ARMmbed#15487.
As I explained in the thread, the easiest way to fix the issue is to update gettimeofday() to not reset the RTC time. It's not intuitive for getting the time to reset the time, just because you didn't call rtc_init() first.
While I was in the RTC code, I also took the opportunity to:
target.lse_bypass
option to be for all STM32 targets, as this is a useful option which should work on all STM32 targets and might be wanted on custom boardstarget.clock_source
andtarget.lse_drive_load_level
optionsImpact of changes
Calling time() or gettimeofday() without calling rtc_init() first will no longer cause the RTC time to be reset to 0.
Migration actions required
Documentation
Pull request type
Test results
Reviewers