Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NUCLEO-F030R8_ExtXtalTest
Fork of mbed-src by
Diff: common/us_ticker_api.c
- Revision:
- 484:b5ae48b573d3
- Parent:
- 481:ca51ab3eed5a
- Child:
- 495:01cb89f68337
--- a/common/us_ticker_api.c Sat Feb 28 07:15:07 2015 +0000 +++ b/common/us_ticker_api.c Tue Mar 03 07:15:07 2015 +0000 @@ -117,6 +117,16 @@ __enable_irq(); } -timestamp_t us_ticker_get_next_timestamp(void) { - return head->timestamp; +int us_ticker_get_next_timestamp(timestamp_t *timestamp) { + int ret = 0; + + /* if head is NULL, there are no pending events */ + __disable_irq(); + if (head != NULL) { + *timestamp = head->timestamp; + ret = 1; + } + __enable_irq(); + + return ret; }