Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LoRaWAN-lib SX1272Lib 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;
}
