Skip to content

Commit c8d72c5

Browse files
author
Cruz Monrreal
authored
Merge pull request #6693 from kjbracey-arm/equeue-ticks
Make event queue use RTOS tick count
2 parents d06ad9b + d979c59 commit c8d72c5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

events/equeue/equeue_mbed.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
#include <stdbool.h>
2424
#include "mbed.h"
2525

26+
// Ticker operations
27+
#if MBED_CONF_RTOS_PRESENT
28+
29+
unsigned equeue_tick() {
30+
return osKernelGetTickCount();
31+
}
32+
33+
#else
34+
2635
#if MBED_CONF_EVENTS_USE_LOWPOWER_TIMER_TICKER
2736
#define ALIAS_TIMER LowPowerTimer
2837
#define ALIAS_TICKER LowPowerTicker
@@ -33,7 +42,6 @@
3342
#define ALIAS_TIMEOUT Timeout
3443
#endif
3544

36-
// Ticker operations
3745
static bool equeue_tick_inited = false;
3846
static volatile unsigned equeue_minutes = 0;
3947
static unsigned equeue_timer[
@@ -77,6 +85,7 @@ unsigned equeue_tick() {
7785
return minutes + ms;
7886
}
7987

88+
#endif
8089

8190
// Mutex operations
8291
int equeue_mutex_create(equeue_mutex_t *m) { return 0; }

events/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"value": 256
2424
},
2525
"use-lowpower-timer-ticker": {
26-
"help": "Enable use of low power timer and ticker classes. May reduce the accuracy of the event queue.",
26+
"help": "Enable use of low power timer and ticker classes in non-RTOS builds. May reduce the accuracy of the event queue. In RTOS builds, the RTOS tick count is used, and this configuration option has no effect.",
2727
"value": 0
2828
}
2929
}

0 commit comments

Comments
 (0)