Skip to content

Display: Add displayHalt routine, call from reportFatalError #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Firmware/RTK_Everywhere/Display.ino
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static QwiicCustomOLED *oled = nullptr;
// Fonts
#include <res/qw_fnt_5x7.h>
#include <res/qw_fnt_8x16.h>
#include <res/qw_fnt_31x48.h>
#include <res/qw_fnt_largenum.h>

// Icons
Expand Down Expand Up @@ -2270,6 +2271,20 @@ void displayEventMarked(uint16_t displayTime)
displayMessage("Event Marked", displayTime);
}

// Print the error message every 15 seconds
void displayHalt()
{
if (online.display)
{
oled->erase(); // Clear the display's internal buffer
int yPos = (oled->getHeight() - 16) / 2;
QwiicFont * font = (oled->getWidth() > 64) ? (QwiicFont *)&QW_FONT_31X48
: (QwiicFont *)&QW_FONT_8X16;
printTextCenter("Halt", yPos, *font, 1, false); // text, y, font type, kerning, inverted
oled->display(); // Push internal buffer to display
}
}

void displayNoLogging(uint16_t displayTime)
{
displayMessage("No Logging", displayTime);
Expand Down
6 changes: 3 additions & 3 deletions Firmware/RTK_Everywhere/RTK_Everywhere.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,6 @@ void setup()
systemPrintln();
systemPrintln();

DMW_b("verifyTables");
verifyTables(); // Verify the consistency of the internal tables

DMW_b("findSpiffsPartition");
if (!findSpiffsPartition())
{
Expand Down Expand Up @@ -1130,6 +1127,9 @@ void setup()
DMW_b("beginDisplay");
beginDisplay(i2cDisplay); // Start display to be able to display any errors

DMW_b("verifyTables");
verifyTables(); // Verify the consistency of the internal tables

beginVersion(); // Assemble platform name. Requires settings/LFS.

DMW_b("beginGnssUart");
Expand Down
1 change: 1 addition & 0 deletions Firmware/RTK_Everywhere/System.ino
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ const char *coordinatePrintableInputType(CoordinateInputType coordinateInputType
// Print the error message every 15 seconds
void reportFatalError(const char *errorMsg)
{
displayHalt();
while (1)
{
systemPrint("HALTED: ");
Expand Down