Skip to content

Commit

Permalink
UX: stop low-cost screensaver when low-cost display is turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Apr 12, 2024
1 parent fefbdf4 commit 9a2d209
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ui_bagl.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ux_set_low_cost_display_mode(bool enable) {
if (G_display.low_cost_display_mode) {
ux_screensaver_start_clock();
} else {
ux_screensaver_stop_clock();
ux_screensaver_stop();
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/ui_screensaver.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ static void ux_layout_blank_init(unsigned int stack_slot) {
ux_stack_display(stack_slot);
}

void ux_screensaver_stop(void) {
G_screensaver_state.on = false;
ux_screensaver_stop_clock();
}

/**
* @brief Exits the blank screen to home screen
*
*/
static void return_to_idle(void) {
G_screensaver_state.on = false;
ux_screensaver_stop();
ui_initial_screen();
}

Expand Down
6 changes: 6 additions & 0 deletions src/ui_screensaver.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ typedef struct {
*/
void ui_start_screensaver(void);

/**
* @brief Stop using the screensaver
*
*/
void ux_screensaver_stop(void);

/**
* @brief Start a timeout before saving screen
*
Expand Down

0 comments on commit 9a2d209

Please sign in to comment.