Issue #934: Handled condition when head is NULL.

pull/936/head
Jeremy Brodt 2015-02-26 08:50:09 -06:00
parent 252d06bc83
commit b53b67ecad
1 changed files with 12 additions and 1 deletions

View File

@ -118,5 +118,16 @@ void us_ticker_remove_event(ticker_event_t *obj) {
}
timestamp_t us_ticker_get_next_timestamp(void) {
return head->timestamp;
__disable_irq();
if (head == NULL) {
__enable_irq();
return 0;
}
timestamp_t next_timestamp = head->timestamp;
__enable_irq();
return next_timestamp;
}