mbed library sources. Supersedes mbed-src.

Dependents:   BREAK_SENSOR_LED

Fork of mbed-dev by mbed official

Revision:
174:b96e65c34a4d
Parent:
160:d5399cc887bb
--- a/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c	Fri Sep 15 14:59:18 2017 +0100
+++ b/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c	Mon Oct 02 15:33:19 2017 +0100
@@ -150,19 +150,19 @@
 {
     TIMER_Stop((TIMER_T *) NU_MODBASE(timer1hires_modinit.modname));
     
-    int delta = (int) (timestamp - us_ticker_read());
-    if (delta > 0) {
-        cd_major_minor_us = delta * US_PER_TICK;
-        us_ticker_arm_cd();
-    }
-    else {
-        cd_major_minor_us = cd_minor_us = 0;
-        /**
-         * This event was in the past. Set the interrupt as pending, but don't process it here.
-         * This prevents a recurive loop under heavy load which can lead to a stack overflow.
-         */  
-        NVIC_SetPendingIRQ(timer1hires_modinit.irq_n);
-    }
+    uint32_t delta = timestamp - us_ticker_read();
+    cd_major_minor_us = delta * US_PER_TICK;
+    us_ticker_arm_cd();
+}
+
+void us_ticker_fire_interrupt(void)
+{
+    cd_major_minor_us = cd_minor_us = 0;
+    /**
+     * This event was in the past. Set the interrupt as pending, but don't process it here.
+     * This prevents a recurive loop under heavy load which can lead to a stack overflow.
+     */  
+    NVIC_SetPendingIRQ(timer1hires_modinit.irq_n);
 }
 
 static void tmr0_vec(void)