Skip to content

Commit 2e9ff47

Browse files
committed
Add an option to use LowPowerTimer for poll
1 parent 7b325f3 commit 2e9ff47

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

platform/mbed_lib.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
"force-non-copyable-error": {
3535
"help": "Force compile time error when a NonCopyable object is copied",
3636
"value": false
37+
},
38+
39+
"poll-use-lowpower-timer": {
40+
"help": "Enable use of low power timer class for poll(). May cause missing events.",
41+
"value": false
3742
}
3843
},
3944
"target_overrides": {

platform/mbed_poll.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ int poll(pollfh fhs[], unsigned nfhs, int timeout)
3434
* interested in. In future, his spinning behaviour will be replaced with
3535
* condition variables.
3636
*/
37+
#if MBED_CONF_PLATFORM_POLL_USE_LOWPOWER_TIMER
38+
LowPowerTimer timer;
39+
#else
3740
Timer timer;
41+
#endif
3842
if (timeout > 0) {
3943
timer.start();
4044
}

0 commit comments

Comments
 (0)