Merge pull request #75 from geeksville/master

fix bugs I noticed while testing a virgin tbeam
pull/78/head
Kevin Hester 2020-04-04 20:55:06 -07:00 zatwierdzone przez GitHub
commit 3acbf31198
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -6,8 +6,7 @@
HardwareSerial _serial_gps(GPS_SERIAL_NUM); HardwareSerial _serial_gps(GPS_SERIAL_NUM);
RTC_DATA_ATTR bool timeSetFromGPS; // We only reset our time once per _boot_ after that point just run from the internal clock bool timeSetFromGPS; // We try to set our time from GPS each time we wake from sleep
// (even across sleeps)
GPS gps; GPS gps;
@ -176,7 +175,9 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s
tv.tv_usec = 0; // time.centisecond() * (10 / 1000); tv.tv_usec = 0; // time.centisecond() * (10 / 1000);
DEBUG_MSG("Got time from GPS month=%d, year=%d, unixtime=%ld\n", t.tm_mon, t.tm_year, tv.tv_sec); DEBUG_MSG("Got time from GPS month=%d, year=%d, unixtime=%ld\n", t.tm_mon, t.tm_year, tv.tv_sec);
if (t.tm_year < 0 || t.tm_year >= 300)
DEBUG_MSG("Ignoring invalid GPS time\n");
else
perhapsSetRTC(&tv); perhapsSetRTC(&tv);
} }

Wyświetl plik

@ -138,7 +138,7 @@ void MeshRadio::loop()
// into CustomRF95 // into CustomRF95
uint32_t now = millis(); uint32_t now = millis();
if (lastTxStart != 0 && (now - lastTxStart) > TX_WATCHDOG_TIMEOUT && radioIf.mode() == RHGenericDriver::RHModeTx) { if (lastTxStart != 0 && (now - lastTxStart) > TX_WATCHDOG_TIMEOUT && radioIf.mode() == RHGenericDriver::RHModeTx) {
DEBUG_MSG("ERROR! Bug! Tx packet took too long to send, forcing radio into rx mode"); DEBUG_MSG("ERROR! Bug! Tx packet took too long to send, forcing radio into rx mode\n");
radioIf.setModeRx(); radioIf.setModeRx();
if (radioIf.sendingPacket) { // There was probably a packet we were trying to send, free it if (radioIf.sendingPacket) { // There was probably a packet we were trying to send, free it
radioIf.pool.release(radioIf.sendingPacket); radioIf.pool.release(radioIf.sendingPacket);