Lora4MakerFaire

Dependencies:   HC_SR04_Ultrasonic_Library X_NUCLEO_IKS01A2 mbed LoRaWAN-lib SX1272Lib

Fork of LoRaWANdemo72 by FabLab LoRa

Revision:
3:3152aa75c58d
Parent:
0:45496a70a8a5
Child:
5:62862ef9480b
diff -r 2eeaeae2c725 -r 3152aa75c58d system/timer.cpp
--- a/system/timer.cpp	Mon Mar 14 09:17:05 2016 +0000
+++ b/system/timer.cpp	Fri May 13 15:14:44 2016 +0000
@@ -40,6 +40,22 @@
     return ( ( TimerTime_t )CurrentTime );
 }
 
+TimerTime_t TimerGetElapsedTime( TimerTime_t savedTime )
+{
+    CurrentTime += TimeCounter.read_us( );
+    TimeCounter.reset( );
+    TimeCounter.start( );
+    return ( TimerTime_t )( CurrentTime - savedTime );
+}
+
+TimerTime_t TimerGetFutureTime( TimerTime_t eventInFuture )
+{
+    CurrentTime += TimeCounter.read_us( );
+    TimeCounter.reset( );
+    TimeCounter.start( );
+    return ( TimerTime_t )( CurrentTime + eventInFuture );
+}
+
 void TimerInit( TimerEvent_t *obj, void ( *callback )( void ) )
 {
     obj->value = 0;