mirror of https://github.com/ARMmbed/mbed-os.git
rearranging some code so that state is tidied up before calling us_ticker_set_interrtupt()
parent
ca9050e1ef
commit
f8fd702c09
|
@ -77,6 +77,10 @@ void us_ticker_insert_event(ticker_event_t *obj, timestamp_t timestamp, uint32_t
|
||||||
prev = p;
|
prev = p;
|
||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if we're at the end p will be NULL, which is correct */
|
||||||
|
obj->next = p;
|
||||||
|
|
||||||
/* if prev is NULL we're at the head */
|
/* if prev is NULL we're at the head */
|
||||||
if (prev == NULL) {
|
if (prev == NULL) {
|
||||||
head = obj;
|
head = obj;
|
||||||
|
@ -84,8 +88,6 @@ void us_ticker_insert_event(ticker_event_t *obj, timestamp_t timestamp, uint32_t
|
||||||
} else {
|
} else {
|
||||||
prev->next = obj;
|
prev->next = obj;
|
||||||
}
|
}
|
||||||
/* if we're at the end p will be NULL, which is correct */
|
|
||||||
obj->next = p;
|
|
||||||
|
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue