From 6c6f570713b6b996dac27cbe43dd11ef3d8ebeef Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 10 Oct 2024 13:46:16 -0500 Subject: [PATCH 1/3] Fixes critical error rendering before screen thread is running --- src/mesh/NodeDB.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 0d96051618..c52dda19db 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1206,7 +1206,8 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co { // Print error to screen and serial port String lcd = String("Critical error ") + code + "!\n"; - screen->print(lcd.c_str()); + if (screen) + screen->print(lcd.c_str()); if (filename) { LOG_ERROR("NOTE! Recording critical error %d at %s:%lu\n", code, filename, address); } else { @@ -1222,4 +1223,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co LOG_ERROR("A critical failure occurred, portduino is exiting..."); exit(2); #endif -} +} \ No newline at end of file From 6c968fb4e4ee611a4541bfd1ae6f6bb5efcdc551 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 10 Oct 2024 13:46:51 -0500 Subject: [PATCH 2/3] Fix GPS thread crashing on probe code attempting to %s print an enum --- src/gps/GPS.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 41061bee8b..7d71556bc7 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1212,19 +1212,19 @@ GnssModel_t GPS::probe(int serialSpeed) } } if (strncmp(info.hwVersion, "00040007", 8) == 0) { - LOG_INFO(DETECTED_MESSAGE, "U-blox 6", GNSS_MODEL_UBLOX6); + LOG_INFO(DETECTED_MESSAGE, "U-blox 6", "6"); return GNSS_MODEL_UBLOX6; } else if (strncmp(info.hwVersion, "00070000", 8) == 0) { - LOG_INFO(DETECTED_MESSAGE, "U-blox 7", GNSS_MODEL_UBLOX7); + LOG_INFO(DETECTED_MESSAGE, "U-blox 7", "7"); return GNSS_MODEL_UBLOX7; } else if (strncmp(info.hwVersion, "00080000", 8) == 0) { - LOG_INFO(DETECTED_MESSAGE, "U-blox 8", GNSS_MODEL_UBLOX8); + LOG_INFO(DETECTED_MESSAGE, "U-blox 8", "8"); return GNSS_MODEL_UBLOX8; } else if (strncmp(info.hwVersion, "00190000", 8) == 0) { - LOG_INFO(DETECTED_MESSAGE, "U-blox 9", GNSS_MODEL_UBLOX9); + LOG_INFO(DETECTED_MESSAGE, "U-blox 9", "9"); return GNSS_MODEL_UBLOX9; } else if (strncmp(info.hwVersion, "000A0000", 8) == 0) { - LOG_INFO(DETECTED_MESSAGE, "U-blox 10", GNSS_MODEL_UBLOX10); + LOG_INFO(DETECTED_MESSAGE, "U-blox 10", "9"); return GNSS_MODEL_UBLOX10; } } @@ -1693,4 +1693,4 @@ void GPS::toggleGpsMode() enable(); } } -#endif // Exclude GPS +#endif // Exclude GPS \ No newline at end of file From f0af641c9562153f56e9683336cb4bcfe771f274 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 10 Oct 2024 13:58:56 -0500 Subject: [PATCH 3/3] 10 --- src/gps/GPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 7d71556bc7..5863fc3434 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1224,7 +1224,7 @@ GnssModel_t GPS::probe(int serialSpeed) LOG_INFO(DETECTED_MESSAGE, "U-blox 9", "9"); return GNSS_MODEL_UBLOX9; } else if (strncmp(info.hwVersion, "000A0000", 8) == 0) { - LOG_INFO(DETECTED_MESSAGE, "U-blox 10", "9"); + LOG_INFO(DETECTED_MESSAGE, "U-blox 10", "10"); return GNSS_MODEL_UBLOX10; } }