diff --git a/src/UIScreen.cpp b/src/UIScreen.cpp index a5489ff..02365a8 100644 --- a/src/UIScreen.cpp +++ b/src/UIScreen.cpp @@ -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"); + } } -}; +} diff --git a/src/UIScreen.h b/src/UIScreen.h index 9734d2e..9f072af 100644 --- a/src/UIScreen.h +++ b/src/UIScreen.h @@ -16,6 +16,7 @@ public: int16_t mainWindowID; Screen(Arduino_GFX *d, UIDimensions dims, UIDecorations decor); + void Setup(); }; }; // namespace Curses