The Screen Submodule provides an api to navigate between different "screens" on the UI. Each screen must provide an enter, update and a leave method; which will be called from this module at the right time. The implemented screens of the application are documented in the Screens module.
typedef void(* SCREEN_CALLBACK) (void *screen) |
Prototype for Event Listeners (called when the screen is entered, left or should be updated)
- Parameters
-
screen | The pointer to the SCREEN_STRUCT where the event occurred |
Definition at line 47 of file screen.h.
Structure to configure the Screen
Navigate one screen back as soon as the app enters the main loop again. It's safe to call this method from an interrupt
- Returns
- true on success
Definition at line 85 of file screen.c.
95 while (current->
next != NULL) {
97 current = current->
next;
struct SCREEN_S * next
Used internally. do not modify, do not initialize.
static SCREEN_STRUCT * screen_current
static volatile SCREEN_STRUCT * screen_goto
static SCREEN_STRUCT * screen_list
Returns the currently active screen
- Returns
- A Pointer to the active SCREEN_STRUCT
Definition at line 35 of file screen.c.
static SCREEN_STRUCT * screen_current
Navigate to the given screen as soon as the app enters the main loop again (and gui_screen_update() is called) It's safe to call this method from an interrupt
- Note
- Do not pass a screen which is already in your history of screens!
- Parameters
-
screen | A Pointer to the preinitialized SCREEN_STRUCT |
- Returns
- true on success
Definition at line 74 of file screen.c.
struct SCREEN_S * next
Used internally. do not modify, do not initialize.
static SCREEN_STRUCT * screen_current
static volatile SCREEN_STRUCT * screen_goto
static SCREEN_STRUCT screen
void gui_screen_update |
( |
| ) |
|
Updates the current screen. Switches the screen if gui_screen_navigate() or gui_screen_back() have been called since the last call to this method. This method should be called repeatedly from the main loop (e.g. app_process())
Definition at line 41 of file screen.c.
47 if (go->
next != NULL) {
SCREEN_CALLBACK on_enter
The Callback which is called when the screen is entered. Add/Register all UI-Elements here...
struct SCREEN_S * next
Used internally. do not modify, do not initialize.
static SCREEN_STRUCT * screen_current
static volatile SCREEN_STRUCT * screen_goto
static SCREEN_STRUCT * screen_list
SCREEN_CALLBACK on_leave
The Callback which is called when the screen is left. Remove/Unregister all UI-Elements here...
SCREEN_CALLBACK on_update
The Callback which is called repeatedly when the screen should be updated. Update/Redraw all UI-Eleme...