mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #864 from 0xc0170/fix_revert_nordic_usticker_#839
HAL - NRF51822 - us ticker fix for the #839pull/629/merge
commit
60e511b0f8
|
@ -70,7 +70,7 @@ void us_ticker_insert_event(ticker_event_t *obj, timestamp_t timestamp, uint32_t
|
||||||
ticker_event_t *prev = NULL, *p = head;
|
ticker_event_t *prev = NULL, *p = head;
|
||||||
while (p != NULL) {
|
while (p != NULL) {
|
||||||
/* check if we come before p */
|
/* check if we come before p */
|
||||||
if ((signedTimestamp_t)(timestamp - p->timestamp) < 0) {
|
if ((int)(timestamp - p->timestamp) < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* go to the next element */
|
/* go to the next element */
|
||||||
|
|
|
@ -23,7 +23,6 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef uint32_t timestamp_t;
|
typedef uint32_t timestamp_t;
|
||||||
typedef int32_t signedTimestamp_t; /* The signed version of the above declaration. */
|
|
||||||
|
|
||||||
uint32_t us_ticker_read(void);
|
uint32_t us_ticker_read(void);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include "cmsis.h"
|
#include "cmsis.h"
|
||||||
#include "PeripheralNames.h"
|
#include "PeripheralNames.h"
|
||||||
#include "app_timer.h"
|
#include "app_timer.h"
|
||||||
#include "projectconfig.h"
|
|
||||||
|
|
||||||
static bool us_ticker_inited = false;
|
static bool us_ticker_inited = false;
|
||||||
static volatile bool us_ticker_appTimerRunning = false;
|
static volatile bool us_ticker_appTimerRunning = false;
|
||||||
|
@ -30,8 +29,7 @@ void us_ticker_init(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
APP_TIMER_INIT(CFG_TIMER_PRESCALER, CFG_TIMER_MAX_INSTANCE, CFG_TIMER_OPERATION_QUEUE_SIZE, CFG_SCHEDULER_ENABLE);
|
APP_TIMER_INIT(0 /*CFG_TIMER_PRESCALER*/ , 1 /*CFG_TIMER_MAX_INSTANCE*/, 1 /*CFG_TIMER_OPERATION_QUEUE_SIZE*/, false /*CFG_SCHEDULER_ENABLE*/);
|
||||||
|
|
||||||
us_ticker_inited = true;
|
us_ticker_inited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue