Skip to content

Commit c90a3a0

Browse files
committed
[Driver] Add API to support insertion of us_timestamp_t in TimerEvent.
1 parent e119357 commit c90a3a0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

drivers/TimerEvent.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ void TimerEvent::insert(timestamp_t timestamp) {
4444
ticker_insert_event(_ticker_data, &event, timestamp, (uint32_t)this);
4545
}
4646

47+
void TimerEvent::insert_absolute(us_timestamp_t timestamp) {
48+
ticker_insert_event(_ticker_data, &event, timestamp, (uint32_t)this);
49+
}
50+
4751
void TimerEvent::remove() {
4852
ticker_remove_event(_ticker_data, &event);
4953
}

drivers/TimerEvent.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ class TimerEvent {
4444
// The handler called to service the timer event of the derived class
4545
virtual void handler() = 0;
4646

47-
// insert in to linked list
47+
// insert relative timestamp in to linked list
4848
void insert(timestamp_t timestamp);
4949

50+
// insert absolute timestamp into linked list
51+
void insert_absolute(us_timestamp_t timestamp);
52+
5053
// remove from linked list, if in it
5154
void remove();
5255

0 commit comments

Comments
 (0)