mQ Branch for NA mote testing
Dependencies: LoRaWAN-lib SX1272Lib-mQ lib_gps lib_mma8451q lib_mpl3115a2 mbed
Fork of LoRaWAN-NAMote72-Application-Demo by
Diff: app/LoRaEventProc.cpp
- Revision:
- 6:f8194e691dd4
- Parent:
- 5:6ffeac53b7cb
- Child:
- 7:92f4f419f91f
--- a/app/LoRaEventProc.cpp Wed Jun 08 01:40:42 2016 +0000 +++ b/app/LoRaEventProc.cpp Wed Jun 08 22:06:26 2016 +0000 @@ -119,6 +119,19 @@ break; } + + // Push-Button Demo + case 11: + { + uint8_t ptrIndex = 0; + + //Point the pointer to position index of Tx Buffer + LoRaApp.ApplicationPtrPos( ptrIndex ); + + LoRaApp.ApplicationCall( AppPushButton ); // Generate Accelerometer data bytes + + break; + } default: break; @@ -161,12 +174,25 @@ } /* Push Button Demo - Send Packet Immedietly + Send Packet Immedietly if PC0 = GND */ case 11: { - DeviceState = DEVICE_STATE_SEND; - NextTx = true; + volatile bool PushButtonStatus; + + PushButtonStatus = PC0; + + if(PushButtonStatus == 0) + { + // Send Pkt immedietly if PC = GND + DeviceState = DEVICE_STATE_SEND; + NextTx = true; + } + else + { + // Keep polling + IsTxIntUpdate = true; + } break; }