-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix rtc api time conversion #4499
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
Conversation
The Ameba RTC driver converts time_t to second/minute/hour/day/month/year in rtc_write and back to time_t in rtc_read. Replace this with an implementation which uses time_t directly.
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa. In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
retest uvisor |
@mazimkhan Can you help to restart uvisor for this patch (or might listen to my command few minutes later?) |
This field is necessary, it is used by several vendor RTC: Atmel, ST, NUVOTON, NXP.
This field is needed by the LPC43XX targets.
/morph test |
travis restarted, time limit reached (seeing it for the first time...) |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@jeromecoutant Please create a separate issue the next time, would help with readability and tracking this. |
Remove usage of mktime and localtime from RTC drivers. This PR was taken from #4479 and expanded to cover all the targets since they have the same issue as ST devices. @pan- feel free to modify this as necessary.