diff --git a/platformio.ini b/platformio.ini
index 50d381c8b..d5fbc07f2 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -314,3 +314,10 @@ src_filter = ${env.src_filter} - - - -
build_flags = ${arduino_base.build_flags} -O0
framework = arduino
board = linux_x86_64
+
+; The GenieBlocks LORA prototype board
+[env:genieblocks_lora]
+extends = esp32_base
+board = genieblocks_lora
+build_flags =
+ ${esp32_base.build_flags} -D GENIEBLOCKS
diff --git a/src/configuration.h b/src/configuration.h
index dda2b8d0b..4f59c840a 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -338,6 +338,35 @@ along with this program. If not, see .
#define LORA_DIO1 35 // Not really used
#define LORA_DIO2 34 // Not really used
+#elif defined(GENIEBLOCKS)
+// This string must exactly match the case used in release file names or the android updater won't work
+#define HW_VENDOR "genieblocks"
+#undef GPS_RX_PIN
+#undef GPS_TX_PIN
+#define GPS_RX_PIN 5
+#define GPS_TX_PIN 18
+#define GPS_RESET_N 10
+#define GPS_EXTINT 23 // On MAX-M8 module pin name is EXTINT. On L70 module pin name is STANDBY.
+
+#define BATTERY_PIN 39 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
+#define BATTERY_EN_PIN 14 // Voltage voltage divider enable pin connected to mosfet
+
+#define I2C_SDA 4 // I2C pins for this board
+#define I2C_SCL 2
+
+#define LED_PIN 12 // If defined we will blink this LED
+//#define BUTTON_PIN 36 // If defined, this will be used for user button presses (ToDo problem on that line on debug screen --> Long press start!)
+//#define BUTTON_NEED_PULLUP //GPIOs 34 to 39 are GPIs – input only pins. These pins don’t have internal pull-ups or pull-down resistors.
+
+#define USE_RF95
+#define LORA_DIO0 38 // a No connect on the SX1262 module
+#define LORA_RESET 9
+
+#define RF95_SCK 22
+#define RF95_MISO 19
+#define RF95_MOSI 13
+#define RF95_NSS 21
+
#endif
#ifdef ARDUINO_NRF52840_PCA10056
diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp
index 387f4c0c4..56b51e0af 100644
--- a/src/gps/RTC.cpp
+++ b/src/gps/RTC.cpp
@@ -36,6 +36,7 @@ bool perhapsSetRTC(RTCQuality q, const struct timeval *tv)
bool shouldSet;
if (q > currentQuality) {
+ currentQuality = q;
shouldSet = true;
DEBUG_MSG("Upgrading time to RTC %ld secs (quality %d)\n", tv->tv_sec, q);
} else if(q == RTCQualityGPS && (now - lastSetMsec) > (12 * 60 * 60 * 1000L)) {
diff --git a/src/main.cpp b/src/main.cpp
index 22648b13a..029f753ea 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -389,6 +389,19 @@ void setup()
readFromRTC(); // read the main CPU RTC at first (in case we can't get GPS time)
+#ifdef GENIEBLOCKS
+ //gps setup
+ pinMode (GPS_RESET_N, OUTPUT);
+ pinMode(GPS_EXTINT, OUTPUT);
+ digitalWrite(GPS_RESET_N, HIGH);
+ digitalWrite(GPS_EXTINT, LOW);
+ //battery setup
+ // If we want to read battery level, we need to set BATTERY_EN_PIN pin to low.
+ // ToDo: For low power consumption after read battery level, set that pin to high.
+ pinMode (BATTERY_EN_PIN, OUTPUT);
+ digitalWrite(BATTERY_EN_PIN, LOW);
+#endif
+
// If we don't have bidirectional comms, we can't even try talking to UBLOX
UBloxGPS *ublox = NULL;
#ifdef GPS_TX_PIN