1
Dependencies: X_NUCLEO_IKS01A1 LoRaWAN-lib SX1276Lib mbed
Diff: app/main.cpp
- Revision:
- 6:711a4e008afa
- Parent:
- 1:80c1daf19aa4
- Child:
- 7:730764a067dc
--- a/app/main.cpp Sun Nov 26 03:26:34 2017 +0000 +++ b/app/main.cpp Tue Nov 28 08:20:09 2017 +0000 @@ -84,6 +84,26 @@ bool IsTxIntUpdate = false; /*! + * Indicates if a new transmit interrupt can be set + */ +bool IsDutyCycleUpdate = false; + +/*! + * Timer to handle the duty cycle + */ +TimerEvent_t TxDutyCycleTimer; + +/*! + * Indicates if a new transmit interrupt can be set + */ +uint16_t DutyCycleCntr = 0; + +/*! + * Indicates if a new transmit interrupt can be set + */ +uint16_t DutyCycleIndx = 0; + +/*! * Indicates if a new packet can be sent */ bool NextTx = true; @@ -147,6 +167,14 @@ InitNextTxInterrupt( AppPort ); } + if( IsDutyCycleUpdate == true ) + { + IsDutyCycleUpdate = false; + + // Initialize next Tx Interrupt + InitDutyCycleTimer( ); + } + if( IsRxUpdate == true ) { // If downlink received then update Serial Terminal and execute Rx event