From cf5c6d7539a2dca090ca71c177f57a2d96df443a Mon Sep 17 00:00:00 2001 From: ballaswag <145094472+ballaswag@users.noreply.github.com> Date: Sun, 28 Apr 2024 00:02:46 -0700 Subject: [PATCH] Fix touch calibration branch. --- src/guppyscreen.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/guppyscreen.cpp b/src/guppyscreen.cpp index c57714e..0e96340 100644 --- a/src/guppyscreen.cpp +++ b/src/guppyscreen.cpp @@ -138,6 +138,20 @@ GuppyScreen *GuppyScreen::init(std::function hal_i /*Assign the new theme to the current display*/ lv_disp_set_theme(NULL, &th_new); + ws.register_notify_update(State::get_instance()); + + GuppyScreen *gs = GuppyScreen::get(); + auto printers = conf->get_json("/printers"); + if (!printers.empty()) { + // start initializing all guppy components + std::string ws_url = fmt::format("ws://{}:{}/websocket", + conf->get(conf->df() + "moonraker_host"), + conf->get(conf->df() + "moonraker_port")); + + spdlog::info("connecting to printer at {}", ws_url); + gs->connect_ws(ws_url); + } + #ifndef OS_ANDROID screen_saver = lv_obj_create(lv_scr_act()); @@ -171,20 +185,6 @@ GuppyScreen *GuppyScreen::init(std::function hal_i } #endif // OS_ANDROID - ws.register_notify_update(State::get_instance()); - - GuppyScreen *gs = GuppyScreen::get(); - auto printers = conf->get_json("/printers"); - if (!printers.empty()) { - // start initializing all guppy components - std::string ws_url = fmt::format("ws://{}:{}/websocket", - conf->get(conf->df() + "moonraker_host"), - conf->get(conf->df() + "moonraker_port")); - - spdlog::info("connecting to printer at {}", ws_url); - gs->connect_ws(ws_url); - } - return gs; }