-
Notifications
You must be signed in to change notification settings - Fork 3k
Add an option to use LowPowerTimer for poll #6418
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
Why is it an option, rather than being This is kind of a general question, as I'm seeing this pattern popping up in lots of places - do we believe the low power timer is broken on certain targets? Why don't we have a "MillisecondTimer" class that automatically directs to low power if available, else microsecond? Why does every piece of code need this ifdef/option? This also relates to #5419 - since that we no longer need a local |
An option makes this change decisively non-breaking, I thought it would get merged easier this way. Happy to change to My thought about losing events was that while it is highly unlikely that |
I guess I'd like some input from those more familiar with the LP timer and power area - it just seems to me that something's not right if code keeps having to do this. I'm pushing back on the pattern - #5419 was a response to #5378 and #5328, which was the equivalent change to this for the event queues. It would feel most natural to me that if the application needs a timer/ticker at all, it should just be specifying "high-res (us)" or "normal-res (ms)" timer. And if the platform doesn't have a separate low-power timer, then both give you the same thing. Perhaps we could arrange for I've no real idea what deep sleep disables on platforms, and thus what might be implicitly relying on the Timer keeping it awake. I guess the concern is that maybe for example the serial port stops working in deep sleep, so the use of |
I note that That's what I'd expect, if it was the case that deep sleep disabled the serial port. So Have you got some other |
@geky - thoughts? |
In my case, I haven't observed any issues with using Regarding typedeffing, I would certainly appreciate it. Currently, I have |
@@ -34,6 +34,11 @@ | |||
"force-non-copyable-error": { | |||
"help": "Force compile time error when a NonCopyable object is copied", | |||
"value": false | |||
}, | |||
|
|||
"poll-use-lowpower-timer": { |
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.
events have something similar:
"use-lowpower-timer-ticker": {
"help": "Enable use of low power timer and ticker classes. May reduce the accuracy of the event queue.",
"value": 0
}
these 2 are similar in functionality, should be aligned
however, lets first answer more important questions here
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 tried to align it as much as possible
Why not use-lowpower-timer
? This would imply that the whole platform
uses LowPowerTimer
Why not poll-use-lowpower-ticker-timer
? There is no ticker here, unlike in events
@c1728p9 @bulislaw Can you review #6418 (comment) please |
Related: #5943 |
I am for this in the short term. I agree with @kjbracey-arm that this pattern is popping up too often. We should introduce a generic class that the application can switch between timer implementations. Honestly, I think users assume the |
@amq - I'm still curious what actual device this helps with. As I commented above, I believe |
@kjbracey-arm my final goal is to be able to run the cellular modem constantly, while keeping the MCU in deep sleep most of the time. From the point of view of my target (EFM32PG12) and modem (ublox Sara G3 / R4), it is possible. There are multiple changes needed to mbed-os to make this happen, and this is one of them, together with e.g. #5943 |
Okay, that makes sense. |
/morph build |
Build : SUCCESSBuild number : 1703 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1337 |
Test : FAILUREBuild number : 1497 |
Odd. Going to see if those failures are repeatable. /morph test |
Test : SUCCESSBuild number : 1508 |
Description
Similar to
use-lowpower-timer-ticker
inevents/
This allows to use LEUART / LPUART with an ability to enter deep sleep.
For example, the cellular modem can stay constantly connected, listening for events, without preventing deep sleep.
Pull request type