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 38:1f3792d6f9ec, committed 2019-02-13
- Comitter:
- Helmut Tschemernjak
- Date:
- Wed Feb 13 14:50:50 2019 +0100
- Parent:
- 37:77fa81e4ad79
- Child:
- 39:ee20fe5c9253
- Commit message:
- Updated MemoryAvailable
Changed in this revision
| utils.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/utils.cpp Wed Feb 13 14:10:17 2019 +0100
+++ b/utils.cpp Wed Feb 13 14:50:50 2019 +0100
@@ -362,23 +362,22 @@
float
GetBrownOutVolt(void)
{
- float borVolt;
unsigned int *FlashOptionRegister = (unsigned int *)0x1FFF7800;
int val = *FlashOptionRegister >> 8 & 0x7; // masking out the BOR bits 9-11
switch(val) {
case 0:
- return borVolt = 1.7;
+ return 1.7;
case 1:
- return borVolt = 2.0;
+ return 2.0;
case 2:
- return borVolt = 2.2;
+ return 2.2;
case 3:
- return borVolt = 2.5;
+ return 2.5;
case 4:
- return borVolt = 2.8;
+ return 2.8;
default:
- return borVolt = 999;
+ return 999;
}
}
@@ -388,6 +387,14 @@
SCB->AIRCR = AIRCR_VECTKEY_MASK | 0x04; // NVIC_GenerateSystemReset();
}
+
+#define FREEMEM_CELL 100
+
+struct elem { /* Definition of a structure that is FREEMEM_CELL bytes in size.) */
+ struct elem *next;
+ char dummy[FREEMEM_CELL-2];
+};
+
size_t
MemoryAvailable(bool print)
{
Helmut Tschemernjak