About GUI menu: Improve rotary handling

This commit is contained in:
Mario Hüttel 2020-06-14 16:26:32 +02:00
parent 20fd7b41e6
commit 7b426c93c9

View File

@ -127,6 +127,21 @@ static void reflow_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry
menu_ack_rotary_delta(menu); menu_ack_rotary_delta(menu);
} }
rot_delta = menu_get_rotary_delta(menu);
if (rot_delta >= 4) {
menu_ack_rotary_delta(menu);
if (page < 4) {
page++;
menu_display_clear(menu);
}
} else if (rot_delta <= -4) {
menu_ack_rotary_delta(menu);
if (page > 0) {
page--;
menu_display_clear(menu);
}
}
switch (page) { switch (page) {
case 0: case 0:
menu_lcd_output(menu, 0, LCD_SHIMATTA_STRING " Shimatta"); menu_lcd_output(menu, 0, LCD_SHIMATTA_STRING " Shimatta");
@ -171,21 +186,6 @@ static void reflow_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry
break; break;
} }
rot_delta = menu_get_rotary_delta(menu);
if (rot_delta >= 4) {
menu_ack_rotary_delta(menu);
if (page < 4) {
page++;
menu_display_clear(menu);
}
} else if (rot_delta <= -4) {
menu_ack_rotary_delta(menu);
if (page > 0) {
page--;
menu_display_clear(menu);
}
}
push_button = menu_get_button_state(menu); push_button = menu_get_button_state(menu);
if (push_button == BUTTON_IDLE) if (push_button == BUTTON_IDLE)