Skip to content

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

Merged
merged 1 commit into from
May 22, 2018

Conversation

bulislaw
Copy link
Member

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

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

#else
#else /* DEVICE_RTC */

#if DEVICE_LOWPOWERTIMER
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

0xc0170
0xc0170 previously approved these changes May 14, 2018
Low power timer will be used as RTC for platforms that don't have HW RTC
capabilities.
@bulislaw
Copy link
Member Author

Can we start the testing please.

@0xc0170
Copy link
Contributor

0xc0170 commented May 18, 2018

/morph build

@0xc0170 0xc0170 requested a review from c1728p9 May 18, 2018 11:14
@mbed-ci
Copy link

mbed-ci commented May 18, 2018

Build : SUCCESS

Build number : 2062
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6878/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 18, 2018

@bulislaw
Copy link
Member Author

This PR doesn't touch anything around F401 or lptimer.
/morph build

@mbed-ci
Copy link

mbed-ci commented May 18, 2018

Build : SUCCESS

Build number : 2069
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6878/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 18, 2018

@mbed-ci
Copy link

mbed-ci commented May 18, 2018

@mbed-ci
Copy link

mbed-ci commented May 19, 2018

@adbridge
Copy link
Contributor

adbridge commented May 21, 2018

@cmonr Are you happy with this?

Testing has passed but this still needs a review from one of the following:
@c1728p9 @SenRamakri Could one of you please review this ASAP.

Copy link
Contributor

@c1728p9 c1728p9 left a 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;
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@SenRamakri SenRamakri left a 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.

@adbridge
Copy link
Contributor

@bulislaw Could you please answer the questions asked ? Though this has not been blocked on them.

@bulislaw
Copy link
Member Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants