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: SX127x lorawan1v1
Fork of LoRaWAN-grove-cayenne by
Revision 3:fc23bbc14475, committed 2018-03-19
- Comitter:
- Wayne Roberts
- Date:
- Mon Mar 19 14:46:37 2018 -0700
- Parent:
- 2:da3c8d5b3f49
- Child:
- 4:72b8fdc9878e
- Commit message:
- move d8 button to ISR for deep sleep
Changed in this revision
| lorawan1v1.lib | Show annotated file Show diff for this revision Revisions of this file |
| sensorDemoVT100.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/lorawan1v1.lib Mon Mar 05 16:51:20 2018 -0800 +++ b/lorawan1v1.lib Mon Mar 19 14:46:37 2018 -0700 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/dudmuck/code/lorawan1v1/#eb174e10afbb +https://os.mbed.com/users/dudmuck/code/lorawan1v1/#e4bfe9183f94
--- a/sensorDemoVT100.cpp Mon Mar 05 16:51:20 2018 -0800
+++ b/sensorDemoVT100.cpp Mon Mar 19 14:46:37 2018 -0700
@@ -162,7 +162,7 @@
#endif
#if defined(TARGET_FF_ARDUINO)
-DigitalIn d8(D8);
+InterruptIn d8(D8);
DigitalOut extLed(D15);
#endif /* TARGET_FF_ARDUINO */
@@ -397,6 +397,7 @@
}
}
+
/*!
* \brief Prepares the payload of the frame
*
@@ -1034,6 +1035,12 @@
}
}
+static void d8isr()
+{
+ c_ch = 0xff;
+ DeviceState = DEVICE_STATE_SEND;
+ buttonStartAt = LoRaMacReadTimer();
+}
static const LoRaMacPrimitives_t LoRaMacPrimitives = {
McpsConfirm,
@@ -1097,6 +1104,7 @@
cayenne_ack_ch = -1;
c_ch = 0xff;
d8.mode(PullDown);
+ d8.rise(d8isr);
mibReq.Type = MIB_ADR;
mibReq.Param.AdrEnable = LORAWAN_ADR_ON;
@@ -1229,18 +1237,15 @@
break;
}
case DEVICE_STATE_TRIGGER:
+ /* wait button ISR */
sleep_manager_sleep_auto();
- if (d8.read() == 1) {
- c_ch = 0xff;
- DeviceState = DEVICE_STATE_SEND;
- buttonStartAt = LoRaMacReadTimer();
- }
break;
default:
DeviceState = DEVICE_STATE_INIT;
break;
} // ..switch( DeviceState )
+ LoRaMacUserContext();
} // ..while( 1 )
}
#endif /* ENABLE_VT100 */
