Better cold extrusion prevention in LCD menu (#12189)

This commit is contained in:
Scott Lahteine 2018-10-22 20:54:38 -05:00 committed by GitHub
parent fc31da1114
commit 3a46212dd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

View file

@ -480,6 +480,9 @@
#ifndef MSG_MOVE_E #ifndef MSG_MOVE_E
#define MSG_MOVE_E _UxGT("Extruder") #define MSG_MOVE_E _UxGT("Extruder")
#endif #endif
#ifndef MSG_HOTEND_TOO_COLD
#define MSG_HOTEND_TOO_COLD _UxGT("Hotend too cold")
#endif
#ifndef MSG_MOVE_01MM #ifndef MSG_MOVE_01MM
#define MSG_MOVE_01MM _UxGT("Move 0.1mm") #define MSG_MOVE_01MM _UxGT("Move 0.1mm")
#endif #endif

View file

@ -341,7 +341,7 @@ millis_t next_lcd_update_ms;
// Used to print static text with no visible cursor. // Used to print static text with no visible cursor.
// Parameters: label [, bool center [, bool invert [, char *value] ] ] // Parameters: label [, bool center [, bool invert [, char *value] ] ]
#define STATIC_ITEM_P(LABEL, ...) \ #define STATIC_ITEM_P(LABEL, ...) do{ \
if (_menuLineNr == _thisItemNr) { \ if (_menuLineNr == _thisItemNr) { \
if (_skipStatic && encoderLine <= _thisItemNr) { \ if (_skipStatic && encoderLine <= _thisItemNr) { \
encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
@ -350,7 +350,7 @@ millis_t next_lcd_update_ms;
if (lcdDrawUpdate) \ if (lcdDrawUpdate) \
lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \ lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \
} \ } \
++_thisItemNr ++_thisItemNr; } while(0)
#define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) #define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__)
@ -3225,10 +3225,17 @@ void lcd_quick_feedback(const bool clear_buttons) {
break; break;
} }
} }
#if ENABLED(PREVENT_COLD_EXTRUSION)
if (thermalManager.tooColdToExtrude(active_extruder))
MENU_BACK(MSG_HOTEND_TOO_COLD);
else
#endif
{
MENU_BACK(MSG_MOVE_AXIS); MENU_BACK(MSG_MOVE_AXIS);
MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); 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_1MM, lcd_move_menu_1mm);
MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
}
END_MENU(); END_MENU();
} }
void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); } void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); }