-
Notifications
You must be signed in to change notification settings - Fork 3k
Add low power timer fallback for platforms without RTC #6878
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
platform/mbed_rtc_time.cpp
Outdated
#else | ||
#else /* DEVICE_RTC */ | ||
|
||
#if DEVICE_LOWPOWERTIMER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any particular reason this and line 30 aren't merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Low power timer will be used as RTC for platforms that don't have HW RTC capabilities.
Can we start the testing please. |
/morph build |
Build : SUCCESSBuild number : 2062 Triggering tests/morph test |
Test : FAILUREBuild number : 1873 |
This PR doesn't touch anything around F401 or lptimer. |
Build : SUCCESSBuild number : 2069 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1709 |
Test : SUCCESSBuild number : 1879 |
Exporter Build : SUCCESSBuild number : 1715 |
@cmonr Are you happy with this? Testing has passed but this still needs a review from one of the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do devices without an RTC typically have a low power timer? If not, the low power timer may need to fall back to the microsecond timer.
#include "drivers/LowPowerTimer.h" | ||
|
||
static SingletonPtr<mbed::LowPowerTimer> _rtc_lp_timer; | ||
static uint64_t _rtc_lp_base; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that _rtc_lp_base is getting written in the write function below, how is it used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_rtc_lp_base
is used as a start time and then we add the actual timer value to it as timer starts from 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good to me. I have one question which I have commented.
@bulislaw Could you please answer the questions asked ? Though this has not been blocked on them. |
Done |
Description
Low power timer will be used as RTC for platforms that don't have HW RTC
capabilities. It will help maintain compatibility between targets and will ensure backward compatibility for targets that will lose RTC support when new HAL RTC API is merged to master.
Pull request type