Lora support for the STM B_L072Z_LRWAN1 board out of the box. Also supports HopeRF RFM95, Murata CMWX1ZZABZ and Semtech SX1276MB1MAS/SX1276MB1LAS modules.

Dependencies:   BufferedSerial SX1276GenericLib mbed USBDeviceHT

Revision:
20:a1029437adca
Parent:
17:98f2528e8399
--- a/utils.cpp	Sun Jun 03 18:33:17 2018 +0000
+++ b/utils.cpp	Sun Jun 03 19:25:37 2018 +0000
@@ -12,6 +12,19 @@
 #endif
 bool _useDprintf;
 
+/*
+ * keep a timer running to avoid USB hangup in sleep,
+ * in newer mbed versions sleep calls deepsleep which may 
+ * hangup the USBSerial.
+ * For this reason we keep a timer pending which avoids deepsleep.
+ */
+static Timeout busyTimer;
+
+void busyTimerFunc(void)
+{
+    busyTimer.attach(callback(&busyTimerFunc), 300);
+}
+
 void InitSerial(int timeout, DigitalOut *led)
 {
     _useDprintf = true;
@@ -39,6 +52,7 @@
                     return;
             }
         }
+        busyTimerFunc();
         return;
     } else {
 #else