mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

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;
 }