mbed library sources

Fork of mbed-src by mbed official

Revision:
495:01cb89f68337
Parent:
484:b5ae48b573d3
Child:
525:c320967f86b9
--- a/common/us_ticker_api.c	Fri Mar 20 09:15:08 2015 +0000
+++ b/common/us_ticker_api.c	Fri Mar 20 09:30:08 2015 +0000
@@ -77,6 +77,10 @@
         prev = p;
         p = p->next;
     }
+
+    /* if we're at the end p will be NULL, which is correct */
+    obj->next = p;
+
     /* if prev is NULL we're at the head */
     if (prev == NULL) {
         head = obj;
@@ -84,8 +88,6 @@
     } else {
         prev->next = obj;
     }
-    /* if we're at the end p will be NULL, which is correct */
-    obj->next = p;
 
     __enable_irq();
 }