mbed

Fork of mbed-dev by mbed official

Revision:
175:b96e65c34a4d
Parent:
162:e13f6fdb2ac4
--- a/targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c	Fri Sep 15 14:59:18 2017 +0100
+++ b/targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c	Mon Oct 02 15:33:19 2017 +0100
@@ -185,13 +185,7 @@
 }
 
 void us_ticker_set_interrupt(timestamp_t timestamp) {
-    int delta = (int)((uint32_t)timestamp - us_ticker_read());
-    if (delta <= 0) {
-        // This event was in the past.  Force it into the very near
-	// future instead.
-	delta = 1;
-    } 
-	
+    uint32_t delta = timestamp - us_ticker_read();
     us_ticker_int_counter   = (uint32_t)(delta >> 16);
     us_ticker_int_remainder = (uint16_t)(0xFFFF & delta);
     if (us_ticker_int_counter > 0) {
@@ -202,3 +196,13 @@
         us_ticker_int_remainder = 0;
     }
 }
+
+void us_ticker_fire_interrupt(void)
+{
+#if defined(TARGET_KL43Z)
+    NVIC_SetPendingIRQ(LPTMR0_IRQn);
+#else
+    NVIC_SetPendingIRQ(LPTimer_IRQn);
+
+#endif
+}