From ee333f6be2204c6a7fe9b254f567412762e62c71 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 May 2018 20:34:59 -0500 Subject: [PATCH] Followup to endstops tweaks --- Marlin/src/lcd/ultralcd.cpp | 2 -- Marlin/src/lcd/ultralcd.h | 26 ++++++++++++-------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 1970bb60c1..be8958fdac 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -5497,11 +5497,9 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } #if BUTTON_EXISTS(EN1) if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; #endif - #if BUTTON_EXISTS(EN2) if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; #endif - #if BUTTON_EXISTS(ENC) if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; #endif diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index d9a059c279..229f4cbce1 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -180,12 +180,6 @@ #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & KEYPAD_HOME) #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & KEYPAD_EN_C) - #if BUTTON_EXISTS(ENC) - #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU) - #else - #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU - #endif - #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \ EN_REPRAPWORLD_KEYPAD_F3 | \ EN_REPRAPWORLD_KEYPAD_F2 | \ @@ -197,14 +191,6 @@ EN_REPRAPWORLD_KEYPAD_LEFT) \ ) - #elif defined(EN_C) - - #define LCD_CLICKED (buttons & EN_C) - - #else - - #define LCD_CLICKED false - #endif #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) @@ -259,6 +245,18 @@ #endif +#if ENABLED(REPRAPWORLD_KEYPAD) + #ifdef EN_C + #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU) + #else + #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU + #endif +#elif defined(EN_C) + #define LCD_CLICKED (buttons & EN_C) +#else + #define LCD_CLICKED false +#endif + #define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x)) #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x))