status_printf => lcd_status_printf_P

This commit is contained in:
Scott Lahteine 2017-04-02 00:46:37 -05:00
parent 0e6ec34228
commit 7a7a80e6c5
4 changed files with 10 additions and 18 deletions

View file

@ -1789,15 +1789,10 @@ static void clean_up_after_endstop_or_probe_move() {
SERIAL_ECHOLNPGM(" " MSG_FIRST); SERIAL_ECHOLNPGM(" " MSG_FIRST);
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)
char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1 lcd_status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : "");
strcat_P(message, PSTR(MSG_HOME " "));
if (xx) strcat_P(message, PSTR(MSG_X));
if (yy) strcat_P(message, PSTR(MSG_Y));
if (zz) strcat_P(message, PSTR(MSG_Z));
strcat_P(message, PSTR(" " MSG_FIRST));
lcd_setstatus(message);
#endif #endif
return true; return true;
} }
return false; return false;
} }
@ -5153,7 +5148,6 @@ inline void gcode_M31() {
char buffer[21]; char buffer[21];
duration_t elapsed = print_job_timer.duration(); duration_t elapsed = print_job_timer.duration();
elapsed.toString(buffer); elapsed.toString(buffer);
lcd_setstatus(buffer); lcd_setstatus(buffer);
SERIAL_ECHO_START; SERIAL_ECHO_START;
@ -5700,7 +5694,7 @@ inline void gcode_M104() {
} }
#endif #endif
if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) status_printf(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING);
} }
#if ENABLED(AUTOTEMP) #if ENABLED(AUTOTEMP)
@ -5898,7 +5892,7 @@ inline void gcode_M109() {
else print_job_timer.start(); else print_job_timer.start();
#endif #endif
if (thermalManager.isHeatingHotend(target_extruder)) status_printf(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); if (thermalManager.isHeatingHotend(target_extruder)) lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING);
} }
#if ENABLED(AUTOTEMP) #if ENABLED(AUTOTEMP)

View file

@ -170,9 +170,7 @@ void Endstops::report_state() {
SERIAL_EOL; SERIAL_EOL;
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)
char msg[3 * strlen(MSG_LCD_ENDSTOPS) + 8 + 1]; // Room for a UTF 8 string lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP);
sprintf_P(msg, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP);
lcd_setstatus(msg);
#endif #endif
hit_on_purpose(); hit_on_purpose();

View file

@ -3565,12 +3565,12 @@ void lcd_setstatuspgm(const char * const message, const uint8_t level) {
lcd_finishstatus(level > 0); lcd_finishstatus(level > 0);
} }
void status_printf(uint8_t level, const char *status, ...) { void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) {
if (level < lcd_status_message_level) return; if (level < lcd_status_message_level) return;
lcd_status_message_level = level; lcd_status_message_level = level;
va_list args; va_list args;
va_start(args, status); va_start(args, fmt);
vsnprintf_P(lcd_status_message, 3 * (LCD_WIDTH), status, args); vsnprintf_P(lcd_status_message, 3 * (LCD_WIDTH), fmt, args);
va_end(args); va_end(args);
lcd_finishstatus(level > 0); lcd_finishstatus(level > 0);
} }

View file

@ -39,7 +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_status_printf_P(const uint8_t level, const char * const fmt, ...);
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();
@ -154,7 +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_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); }
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; }