Add support for BACK button (if any) (#9836)

This commit is contained in:
Scott Lahteine 2018-02-26 22:53:08 -06:00 committed by GitHub
parent 1eb3364ac9
commit 2bde53bd46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 12 deletions

View file

@ -4847,11 +4847,9 @@ void lcd_init() {
#if BUTTON_EXISTS(EN1)
SET_INPUT_PULLUP(BTN_EN1);
#endif
#if BUTTON_EXISTS(EN2)
SET_INPUT_PULLUP(BTN_EN2);
#endif
#if BUTTON_EXISTS(ENC)
SET_INPUT_PULLUP(BTN_ENC);
#endif
@ -4996,6 +4994,14 @@ void lcd_update() {
}
}
else wait_for_unclick = false;
#if BUTTON_EXISTS(BACK)
if (LCD_BACK_CLICKED) {
lcd_quick_feedback();
lcd_goto_previous_menu();
}
#endif
#endif
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
@ -5367,6 +5373,9 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#if BUTTON_EXISTS(ENC)
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
#endif
#if BUTTON_EXISTS(BACK)
if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
#endif
//
// Directional buttons