fix: resolve early boot heap corruption via local static entities

This commit is contained in:
Wferr
2026-01-05 00:34:33 -08:00
parent 14972b34cb
commit aa6fa04bba
2 changed files with 66 additions and 49 deletions

View File

@@ -252,6 +252,16 @@ void setupDisplayAndFonts() {
void setup() {
t1 = millis();
// Check heap integrity after potential static initialization issues.
// If corruption is found, we surface it to the display and stop.
if (!heap_caps_check_integrity_all(true)) {
Serial.println("!!! HEAP CORRUPTION DETECTED AT BOOT !!!");
setupDisplayAndFonts();
exitActivity();
enterNewActivity(new FullScreenMessageActivity(renderer, mappedInputManager, "Heap corruption", EpdFontFamily::BOLD));
return;
}
// Only start serial if USB connected
pinMode(UART0_RXD, INPUT);
if (digitalRead(UART0_RXD) == HIGH) {