Lancaster University's (short term!) clone of mbed-src for micro:bit. This is a copy of the github branch https://github.com/lancaster-university/mbed-classic

Fork of mbed-src by mbed official

Revision:
495:01cb89f68337
Parent:
484:b5ae48b573d3
Child:
525:c320967f86b9
diff -r 41cd0bfadcd0 -r 01cb89f68337 common/us_ticker_api.c
--- 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();
 }