Bootcamp application example using LoRaWAN-lib MAC layer implementation. Provides an application example controlling a 3 color LED and a light sensor.
Dependencies: mbed Chainable_RGB_LED DigitDisplay LoRaWAN-lib SX1276Lib
For a detailed description of the LoRaWAN operations, please visit the MBED dedicated page at https://developer.mbed.org/teams/Semtech/code/LoRaWAN-demo-76/
Diff: system/timer.cpp
- Revision:
- 1:21e3eef8200f
- Parent:
- 0:cb80564f40e1
- Child:
- 3:de1dcfbe175a
--- a/system/timer.cpp Thu Mar 17 09:32:46 2016 +0000 +++ b/system/timer.cpp Fri May 13 15:52:23 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;