diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b10ee6713..537c3c0bb 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5308,7 +5308,7 @@ inline void gcode_M104() { } #endif - if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); + if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) status_printf(0, "E%i %s", target_extruder + 1, MSG_HEATING); } #if ENABLED(AUTOTEMP) @@ -5506,7 +5506,7 @@ inline void gcode_M109() { else print_job_timer.start(); #endif - if (thermalManager.isHeatingHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); + if (thermalManager.isHeatingHotend(target_extruder)) status_printf(0, "E%i %s", target_extruder + 1, MSG_HEATING); } #if ENABLED(AUTOTEMP) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c34688438..5e4012ac2 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -3272,6 +3272,16 @@ void lcd_setstatuspgm(const char* const message, uint8_t level) { lcd_finishstatus(level > 0); } +void status_printf(uint8_t level, const char *status, ...) { + if (level < lcd_status_message_level) return; + lcd_status_message_level = level; + va_list args; + va_start(args, status); + vsnprintf(lcd_status_message, 3 * (LCD_WIDTH), status, args); + va_end(args); + lcd_finishstatus(level > 0); +} + void lcd_setalertstatuspgm(const char* const message) { lcd_setstatuspgm(message, 1); #if ENABLED(ULTIPANEL) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 8e2227af4..f5b54f96d 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -39,6 +39,7 @@ bool lcd_hasstatus(); void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatuspgm(const char* message, const uint8_t level=0); + void status_printf(uint8_t level, const char *Status, ...); void lcd_setalertstatuspgm(const char* message); void lcd_reset_alert_level(); void lcd_kill_screen(); @@ -153,6 +154,7 @@ inline bool lcd_hasstatus() { return false; } inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } inline void lcd_setstatuspgm(const char* const message, const uint8_t level=0) { UNUSED(message); UNUSED(level); } + inline void status_printf(uint8_t level, const char *status, ...) { UNUSED(level); UNUSED(status); } inline void lcd_buttons_update() {} inline void lcd_reset_alert_level() {} inline bool lcd_detected() { return true; }