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
Diff: utils.cpp
- Revision:
- 1:56fdc660a26a
- Parent:
- 0:3b6c2ce051a6
- Child:
- 5:c6a960febe80
--- a/utils.cpp Fri Jan 18 15:59:46 2019 +0000 +++ b/utils.cpp Sun Jan 20 15:05:59 2019 +0100 @@ -1,8 +1,8 @@ /* - * Copyright (c) 2018 Helmut Tschemernjak + * Copyright (c) 2019 Helmut Tschemernjak * 30826 Garbsen (Hannover) Germany */ - #include "main.h" +#include "main.h" time_t cvt_date(char const *date, char const *time); @@ -205,3 +205,33 @@ t.tm_year = year - 1900; return (int)mktime(&t); } + + + +void InterrruptMSG(enum InterrruptDevice irqid) { + help_atomic_or_relaxed(&PendingInterrupts, irqid); +} + + +uint32_t readclrPendingInterrupts() { + return help_atomic_readclr_relaxed(&PendingInterrupts); +} + +uint32_t readPendingInterrupts() { + return help_atomic_load_relaxed(&PendingInterrupts); +} + +const char * +BatterySource(void) +{ + const char *pwrSource = "Battery"; +#ifdef BATPOWER_EN + { + DigitalIn pwr(BATPOWER_EN); + if (pwr == BATPOWER_EXT) + pwrSource = "USB"; + } +#endif + return pwrSource; +} +