Merge pull request #6693 from kjbracey-arm/equeue-ticks

Make event queue use RTOS tick count
pull/6762/head
Cruz Monrreal 2018-04-26 20:20:42 -05:00 committed by GitHub
commit c8d72c524d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -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; }

View File

@ -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
}
}