Merge upstream/dev (8 commits) [upstream-sync]
This commit is contained in:
commit
388d9064e8
4 files changed
+24
No files matched your search
@@ -456,12 +456,14 @@ public:
|
|||||||
bool hw_gps_state = nmea != NULL && nmea->isHardwareEnabled();
|
bool hw_gps_state = nmea != NULL && nmea->isHardwareEnabled();
|
||||||
uint32_t period = nmea != NULL ? nmea->getGpsPeriod() : 0;
|
uint32_t period = nmea != NULL ? nmea->getGpsPeriod() : 0;
|
||||||
char fix_buf[12] = "";
|
char fix_buf[12] = "";
|
||||||
|
bool hasFix = false;
|
||||||
if (nmea != NULL) {
|
if (nmea != NULL) {
|
||||||
uint32_t fix_age = nmea->getLastFixAge();
|
uint32_t fix_age = nmea->getLastFixAge();
|
||||||
if (fix_age == UINT32_MAX) {
|
if (fix_age == UINT32_MAX) {
|
||||||
strcpy(fix_buf, "no fix");
|
strcpy(fix_buf, "no fix");
|
||||||
} else {
|
} else {
|
||||||
formatFixAge(fix_buf, sizeof(fix_buf), fix_age);
|
formatFixAge(fix_buf, sizeof(fix_buf), fix_age);
|
||||||
|
hasFix = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nmea != NULL && nmea->hasHardwareEnableState() && gps_state != hw_gps_state) {
|
if (nmea != NULL && nmea->hasHardwareEnableState() && gps_state != hw_gps_state) {
|
||||||
@@ -490,6 +492,7 @@ public:
|
|||||||
display.setColor(UIColor::primary_txt);
|
display.setColor(UIColor::primary_txt);
|
||||||
sprintf(buf, "%d", nmea->satellitesCount());
|
sprintf(buf, "%d", nmea->satellitesCount());
|
||||||
display.drawTextRightAlign(display.width()-1, y, buf);
|
display.drawTextRightAlign(display.width()-1, y, buf);
|
||||||
|
if (!hasFix) return 5000;
|
||||||
y = y + 12;
|
y = y + 12;
|
||||||
display.setColor(UIColor::secondary_txt);
|
display.setColor(UIColor::secondary_txt);
|
||||||
display.drawTextLeftAlign(0, y, "pos");
|
display.drawTextLeftAlign(0, y, "pos");
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ build_flags = ${nrf52_base.build_flags}
|
|||||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||||
-D SX126X_CURRENT_LIMIT=140
|
-D SX126X_CURRENT_LIMIT=140
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
|
-D SX126X_REGISTER_PATCH=1 ; Patch register 0x8B5 for improved RX
|
||||||
-D PIN_VEXT_EN=26 ; Vext is connected to VDD which is also connected to TFT & GPS
|
-D PIN_VEXT_EN=26 ; Vext is connected to VDD which is also connected to TFT & GPS
|
||||||
-D PIN_VEXT_EN_ACTIVE=HIGH
|
-D PIN_VEXT_EN_ACTIVE=HIGH
|
||||||
-D PIN_GPS_RX=25
|
-D PIN_GPS_RX=25
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ build_flags =
|
|||||||
-D PIN_BUZZER=6
|
-D PIN_BUZZER=6
|
||||||
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
||||||
-D ENABLE_USB_INTERFACE
|
-D ENABLE_USB_INTERFACE
|
||||||
|
-D ENV_INCLUDE_GPS=1
|
||||||
build_src_filter = ${ThinkNode_M1.build_src_filter}
|
build_src_filter = ${ThinkNode_M1.build_src_filter}
|
||||||
+<helpers/ui/GxEPDDisplay.cpp>
|
+<helpers/ui/GxEPDDisplay.cpp>
|
||||||
+<helpers/ui/buzzer.cpp>
|
+<helpers/ui/buzzer.cpp>
|
||||||
|
|||||||
@@ -5,9 +5,28 @@
|
|||||||
|
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
|
|
||||||
|
// A reset in the middle of an RTC read can leave the RTC holding SDA low,
|
||||||
|
// and the RTC probe at boot then hangs forever. Up to nine clock pulses let
|
||||||
|
// it finish its byte and release the bus.
|
||||||
|
static void recoverI2cBus() {
|
||||||
|
pinMode(PIN_WIRE_SDA, INPUT_PULLUP);
|
||||||
|
pinMode(PIN_WIRE_SCL, INPUT_PULLUP);
|
||||||
|
MESH_DEBUG_PRINTLN("I2C at boot: SDA=%d SCL=%d", digitalRead(PIN_WIRE_SDA), digitalRead(PIN_WIRE_SCL));
|
||||||
|
pinMode(PIN_WIRE_SCL, OUTPUT);
|
||||||
|
digitalWrite(PIN_WIRE_SCL, HIGH);
|
||||||
|
for (int i = 0; i < 9 && digitalRead(PIN_WIRE_SDA) == LOW; i++) {
|
||||||
|
digitalWrite(PIN_WIRE_SCL, LOW);
|
||||||
|
delayMicroseconds(5);
|
||||||
|
digitalWrite(PIN_WIRE_SCL, HIGH);
|
||||||
|
delayMicroseconds(5);
|
||||||
|
}
|
||||||
|
pinMode(PIN_WIRE_SCL, INPUT_PULLUP);
|
||||||
|
}
|
||||||
|
|
||||||
void ThinkNodeM6Board::begin() {
|
void ThinkNodeM6Board::begin() {
|
||||||
NRF52Board::begin();
|
NRF52Board::begin();
|
||||||
|
|
||||||
|
recoverI2cBus();
|
||||||
Wire.begin();
|
Wire.begin();
|
||||||
|
|
||||||
#ifdef P_LORA_TX_LED
|
#ifdef P_LORA_TX_LED
|
||||||
|
|||||||
Reference in new issue
Block a user