Skip to content
Snippets Groups Projects
Commit 8ca760f4 authored by minute's avatar minute
Browse files

Merge branch 'add-logo-timeout' into 'master'

Add a ~30s timeout to the MNT Reform logo on the OLED

See merge request reform/reform!50
parents bd6d5d88 d9c49e8c
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
int current_menu_y = 0;
int current_scroll_y = 0;
int current_menu_page = 0;
int8_t logo_timeout_ticks = 0;
#ifdef KBD_MODE_STANDALONE
#define MENU_NUM_ITEMS 5
......@@ -71,6 +72,10 @@ void render_menu(int y) {
void refresh_menu_page() {
if (current_menu_page == MENU_PAGE_BATTERY_STATUS) {
remote_get_voltages();
} else if (current_menu_page == MENU_PAGE_MNT_LOGO && --logo_timeout_ticks <= 0) {
gfx_clear();
gfx_flush();
reset_menu();
}
}
......@@ -171,6 +176,8 @@ int execute_meta_function(int keycode) {
}
void anim_hello(void) {
current_menu_page = MENU_PAGE_MNT_LOGO;
logo_timeout_ticks = 10; // ~30sec
gfx_clear();
gfx_on();
for (int y=0; y<3; y++) {
......
......@@ -15,6 +15,7 @@ typedef struct MenuItem {
#define MENU_PAGE_NONE 0
#define MENU_PAGE_OTHER 1
#define MENU_PAGE_BATTERY_STATUS 2
#define MENU_PAGE_MNT_LOGO 3
void reset_and_render_menu(void);
void reset_menu(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment