Instantiate the main waiting screen in a separate function.
@@ -34,16 +34,22 @@ void ui_screen_render_component(component_t* component)
UG_SendBuffer();
}
-static void _screen_process(bool (*is_done)(void), void (*on_timeout)(void), const uint32_t timeout)
+static component_t *get_waiting_screen(void)
{
static component_t* waiting_screen = NULL;
- uint32_t timeout_cnt = 0;
if (waiting_screen == NULL) {
waiting_screen = waiting_create();
if (waiting_screen == NULL) {
- Abort("could not create\nwaiting screen");
+ Abort("Could not create\nwaiting screen");
}
}
+ return waiting_screen;
+}
+
+static void _screen_process(bool (*is_done)(void), void (*on_timeout)(void), const uint32_t timeout)
+{
+ component_t* waiting_screen = get_waiting_screen();
+ uint32_t timeout_cnt = 0;
bool screen_new = false;
component_t* component = NULL;
