Merge pull request #5876 from thinkyhead/rc_hotend_status

Add status_printf to print messages to the lcd status line.
This commit is contained in:
Scott Lahteine 2017-02-20 17:29:27 -06:00 committed by GitHub
commit 2efdc72aa5
3 changed files with 14 additions and 2 deletions

View File

@ -5308,7 +5308,7 @@ inline void gcode_M104() {
} }
#endif #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) #if ENABLED(AUTOTEMP)
@ -5506,7 +5506,7 @@ inline void gcode_M109() {
else print_job_timer.start(); else print_job_timer.start();
#endif #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) #if ENABLED(AUTOTEMP)

View File

@ -3272,6 +3272,16 @@ void lcd_setstatuspgm(const char* const message, uint8_t level) {
lcd_finishstatus(level > 0); 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) { void lcd_setalertstatuspgm(const char* const message) {
lcd_setstatuspgm(message, 1); lcd_setstatuspgm(message, 1);
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

View File

@ -39,6 +39,7 @@
bool lcd_hasstatus(); bool lcd_hasstatus();
void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatus(const char* message, const bool persist=false);
void lcd_setstatuspgm(const char* message, const uint8_t level=0); 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_setalertstatuspgm(const char* message);
void lcd_reset_alert_level(); void lcd_reset_alert_level();
void lcd_kill_screen(); void lcd_kill_screen();
@ -153,6 +154,7 @@
inline bool lcd_hasstatus() { return false; } 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_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 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_buttons_update() {}
inline void lcd_reset_alert_level() {} inline void lcd_reset_alert_level() {}
inline bool lcd_detected() { return true; } inline bool lcd_detected() { return true; }