[Driver] Add API to support insertion of us_timestamp_t in TimerEvent.

pull/4094/head
Vincent Coubard 2017-03-31 14:30:42 +01:00
parent e119357822
commit c90a3a007a
2 changed files with 8 additions and 1 deletions

View File

@ -44,6 +44,10 @@ void TimerEvent::insert(timestamp_t timestamp) {
ticker_insert_event(_ticker_data, &event, timestamp, (uint32_t)this);
}
void TimerEvent::insert_absolute(us_timestamp_t timestamp) {
ticker_insert_event(_ticker_data, &event, timestamp, (uint32_t)this);
}
void TimerEvent::remove() {
ticker_remove_event(_ticker_data, &event);
}

View File

@ -44,9 +44,12 @@ protected:
// The handler called to service the timer event of the derived class
virtual void handler() = 0;
// insert in to linked list
// insert relative timestamp in to linked list
void insert(timestamp_t timestamp);
// insert absolute timestamp into linked list
void insert_absolute(us_timestamp_t timestamp);
// remove from linked list, if in it
void remove();