An example project for the Heltec Turtle LoRa board (STM32L4 and SX1276 chips). The projects is only supported for the Nucleo-L432KC board platform in the mbed online and offline compiler environment. Visit www.radioshuttle.de (choose Turtle board) for instructions. Note that most source files and libraries are open source, however some files especially the RadioShuttle core protocol is copyrighted work. Check header for details.

Dependencies:   mbed BufferedSerial SX1276GenericLib OLED_SSD1306 HELIOS_Si7021 NVProperty RadioShuttle-STM32L4 USBDeviceHT

Revision:
45:22bb680cad5a
Parent:
37:77fa81e4ad79
Child:
47:59a9923a9f77
--- a/main.cpp	Fri Feb 15 10:53:47 2019 +0100
+++ b/main.cpp	Sun Feb 24 14:57:36 2019 +0100
@@ -6,7 +6,8 @@
 
  /*
   * TODO:
-  * Compiler Date/Time is not set correctly on startup
+  * Compiler Date/Time is not set correctly on startup using gcc
+  * USB Serial block deepsleep
   */
 #include "main.h"
 #include "RadioTest.h"
@@ -40,7 +41,7 @@
      * blinking LED means USBSerial detected, waiting for a connect.
      * It waits up to 30 seconds for a USB terminal connections 
      */
-    InitSerial(30*1000, &statusLED);
+    InitSerial(30*1000, &statusLED, &buttonIntr);
 	RunStartup();
 	dprintf("Welcome to RadioShuttle v%d.%d", RS_MAJOR, RS_MINOR);
     timerUpdate(); // start timer for status blinked, can be disalbed to save energy
@@ -57,17 +58,14 @@
 #endif
 
 	/*
-	 * Main event loop, process interrupts and go to sleep
+	 * Main event loop, process interrupts and goes to sleep when idle.
 	 * the green statusLED indicates CPU activity
-	 * the red redLED indicates that low power timeout function is running.
+	 * the red redLED indicates that low power timerUpdate function is running.
 	 */
 	while(true) {
         while ((readPendingInterrupts() == 0)) {
 			statusLED = 0;
-#ifdef FEATURE_USBSERIAL
-			if (!(usb && usb->connected()))
-#endif
-				sleep();
+			sleep();
 			statusLED = 1;
         }