LoRa node acquiring analog input and sending to LoRa Server - Working ok

Dependents:   DISCO-L072CZ-LRWAN1_LoRa_node EIoT_LoRa_node_1 EIoT_LoRa_node_2 EIoT_LoRa_node_3

Fork of SX1276GenericLib by Helmut Tschemernjak

Revision:
87:5f31c157ed15
Parent:
86:49d19df5bbce
Child:
97:3d5d489206aa
--- a/Arduino-mbed-APIs/arduino-d21.cpp	Thu Aug 17 11:07:50 2017 +0200
+++ b/Arduino-mbed-APIs/arduino-d21.cpp	Wed Aug 23 16:26:21 2017 +0200
@@ -411,9 +411,14 @@
      * when in sleep mode. */
     NVMCTRL->CTRLB.bit.SLEEPPRM = NVMCTRL_CTRLB_SLEEPPRM_DISABLED_Val;
 #endif
+    if (!(GCLK->CLKCTRL.reg & GCLK_CLKCTRL_GEN_GCLK1)) {
+        // Configure EIC to use GCLK1 which uses XOSC32K
+        // This has to be done after the first call to attachInterrupt()
+        // GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID(GCM_EIC) | GCLK_CLKCTRL_GEN_GCLK1 | GCLK_CLKCTRL_CLKEN;
+    }
     
     SCB->SCR |=  SCB_SCR_SLEEPDEEP_Msk; // standby mode
-    //EIC->WAKEUP.bit.WAKEUPEN3 = 1; // enable wakeup on Pin 12/PA19/EXTINT[3] see variants.h
+	// EIC->WAKEUP.bit.WAKEUPEN3 = 1; // enable wakeup on Pin 12/PA19/EXTINT[3] see variants.h
     
     __DSB(); // ensures the completion of memory accesses
     __WFI(); // wait for interrupt