LoRaWAN demo.
Dependencies: modem_ref_helper DebouncedInterrupt
Diff: main.cpp
- Revision:
- 1:bca89c43e171
- Parent:
- 0:06ba20deb797
- Child:
- 2:9112445299fa
--- a/main.cpp Fri Sep 22 14:17:19 2017 +0000 +++ b/main.cpp Wed Oct 18 13:52:39 2017 +0000 @@ -22,13 +22,13 @@ Queue<void, 8> g_file_modified; Queue<void, 8> modem_resp; -bool lora_ready = false; +bool alarm_ready = false; // This is WizziLab's The Things Network LoRaWAN configuration file // This device is already registered on WizziLab's APP +// // You can create your own account to get custom app_id and app_key. // The device EUI is the modem's UID. -// // https://account.thethingsnetwork.org/register // https://console.thethingsnetwork.org/applications lwan_itf_cfg_t lwan_itf_ttn = { @@ -54,7 +54,7 @@ // Interrupt Service Routine on button press. void button_push_isr( void ) { - if (lora_ready) + if (alarm_ready) { button_user.release(); } @@ -217,14 +217,6 @@ } } -// Misc -// ============================================================{{{ - -void my_get_alp_file_props(uint8_t fid, alp_file_header_t* hdr) -{ - memcpy(hdr, ram_fs_get_header(fid), sizeof(alp_file_header_t)); -} - void button_user_thread() { FPRINT("(id:0x%08x)\r\n", osThreadGetId()); @@ -243,9 +235,9 @@ { // Wait for button press PRINT("PRESS BUTTON TO SEND LORAWAN ALARM...\r\n"); - lora_ready = true; + alarm_ready = true; button_user.wait(); - lora_ready = false; + alarm_ready = false; // load/save value to keep choerency in case of remote access... ram_fs_read(FID_ALARM, 0, SIZE_ALARM, &alarm);