From 3a46212dd84697d9b84ce59462f351785aedd3b3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 22 Oct 2018 20:54:38 -0500 Subject: [PATCH] Better cold extrusion prevention in LCD menu (#12189) --- Marlin/src/lcd/language/language_en.h | 3 +++ Marlin/src/lcd/ultralcd.cpp | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 384068d7b..4dea9441e 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -480,6 +480,9 @@ #ifndef MSG_MOVE_E #define MSG_MOVE_E _UxGT("Extruder") #endif +#ifndef MSG_HOTEND_TOO_COLD + #define MSG_HOTEND_TOO_COLD _UxGT("Hotend too cold") +#endif #ifndef MSG_MOVE_01MM #define MSG_MOVE_01MM _UxGT("Move 0.1mm") #endif diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 07fa3d1fe..7a86b4a9f 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -341,7 +341,7 @@ millis_t next_lcd_update_ms; // Used to print static text with no visible cursor. // Parameters: label [, bool center [, bool invert [, char *value] ] ] - #define STATIC_ITEM_P(LABEL, ...) \ + #define STATIC_ITEM_P(LABEL, ...) do{ \ if (_menuLineNr == _thisItemNr) { \ if (_skipStatic && encoderLine <= _thisItemNr) { \ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ @@ -350,7 +350,7 @@ millis_t next_lcd_update_ms; if (lcdDrawUpdate) \ lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \ } \ - ++_thisItemNr + ++_thisItemNr; } while(0) #define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) @@ -3225,10 +3225,17 @@ void lcd_quick_feedback(const bool clear_buttons) { break; } } - MENU_BACK(MSG_MOVE_AXIS); - MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); - MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm); - MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); + #if ENABLED(PREVENT_COLD_EXTRUSION) + if (thermalManager.tooColdToExtrude(active_extruder)) + MENU_BACK(MSG_HOTEND_TOO_COLD); + else + #endif + { + MENU_BACK(MSG_MOVE_AXIS); + MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); + MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm); + MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); + } END_MENU(); } void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); }