From 7020c50c56d66d0ca6b4a11a95671c396d9e8c3b Mon Sep 17 00:00:00 2001 From: Jeremy Brodt Date: Tue, 24 Feb 2015 14:25:43 -0600 Subject: [PATCH] Added function to get the timestamp of the next us_ticker event. --- libraries/mbed/common/us_ticker_api.c | 4 ++++ libraries/mbed/hal/us_ticker_api.h | 1 + 2 files changed, 5 insertions(+) diff --git a/libraries/mbed/common/us_ticker_api.c b/libraries/mbed/common/us_ticker_api.c index 9d9c6562be..f98b56a9e8 100644 --- a/libraries/mbed/common/us_ticker_api.c +++ b/libraries/mbed/common/us_ticker_api.c @@ -116,3 +116,7 @@ void us_ticker_remove_event(ticker_event_t *obj) { __enable_irq(); } + +timestamp_t us_ticker_get_next_timestamp(void) { + return head->timestamp; +} diff --git a/libraries/mbed/hal/us_ticker_api.h b/libraries/mbed/hal/us_ticker_api.h index b7df3b57a1..543c4da934 100644 --- a/libraries/mbed/hal/us_ticker_api.h +++ b/libraries/mbed/hal/us_ticker_api.h @@ -43,6 +43,7 @@ void us_ticker_irq_handler(void); void us_ticker_insert_event(ticker_event_t *obj, timestamp_t timestamp, uint32_t id); void us_ticker_remove_event(ticker_event_t *obj); +timestamp_t us_ticker_get_next_timestamp(void); #ifdef __cplusplus }