Added a way to lock execution if the main screen fails to initialize

This commit is contained in:
2025-11-11 22:44:50 +00:00
parent c9666792df
commit 69868c1b31
2 changed files with 9 additions and 2 deletions
+8 -2
View File
@@ -4,12 +4,18 @@
#include "UIDimensions.h"
Curses::Screen::Screen(Arduino_GFX *d, UIDimensions dims, UIDecorations decor)
: display(d), dims(dims), decor(decor) {
: display(d), dims(dims), decor(decor) {}
void Curses::Screen::Setup() {
// This should always return the first available component
this->mainWindowID = WindowPool::Allocate();
if (this->mainWindowID != 0) {
// Something wrong happened
Serial2.print("Unexpected ID for main window: ");
Serial2.println(this->mainWindowID);
for (;;) {
delay(1000);
Serial2.println("Program interrupted due to setup failure");
}
}
};
}
+1
View File
@@ -16,6 +16,7 @@ public:
int16_t mainWindowID;
Screen(Arduino_GFX *d, UIDimensions dims, UIDecorations decor);
void Setup();
};
}; // namespace Curses