mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #6693 from kjbracey-arm/equeue-ticks
Make event queue use RTOS tick countpull/6762/head
commit
c8d72c524d
|
@ -23,6 +23,15 @@
|
|||
#include <stdbool.h>
|
||||
#include "mbed.h"
|
||||
|
||||
// Ticker operations
|
||||
#if MBED_CONF_RTOS_PRESENT
|
||||
|
||||
unsigned equeue_tick() {
|
||||
return osKernelGetTickCount();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if MBED_CONF_EVENTS_USE_LOWPOWER_TIMER_TICKER
|
||||
#define ALIAS_TIMER LowPowerTimer
|
||||
#define ALIAS_TICKER LowPowerTicker
|
||||
|
@ -33,7 +42,6 @@
|
|||
#define ALIAS_TIMEOUT Timeout
|
||||
#endif
|
||||
|
||||
// Ticker operations
|
||||
static bool equeue_tick_inited = false;
|
||||
static volatile unsigned equeue_minutes = 0;
|
||||
static unsigned equeue_timer[
|
||||
|
@ -77,6 +85,7 @@ unsigned equeue_tick() {
|
|||
return minutes + ms;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Mutex operations
|
||||
int equeue_mutex_create(equeue_mutex_t *m) { return 0; }
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"value": 256
|
||||
},
|
||||
"use-lowpower-timer-ticker": {
|
||||
"help": "Enable use of low power timer and ticker classes. May reduce the accuracy of the event queue.",
|
||||
"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.",
|
||||
"value": 0
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue