Browse Source

status_printf => lcd_status_printf_P

pull/1/head
Scott Lahteine 8 years ago
parent
commit
7a7a80e6c5
  1. 14
      Marlin/Marlin_main.cpp
  2. 4
      Marlin/endstops.cpp
  3. 6
      Marlin/ultralcd.cpp
  4. 4
      Marlin/ultralcd.h

14
Marlin/Marlin_main.cpp

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

4
Marlin/endstops.cpp

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

6
Marlin/ultralcd.cpp

@ -3565,12 +3565,12 @@ void lcd_setstatuspgm(const char * const message, const uint8_t level) {
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;
lcd_status_message_level = level;
va_list args;
va_start(args, status);
vsnprintf_P(lcd_status_message, 3 * (LCD_WIDTH), status, args);
va_start(args, fmt);
vsnprintf_P(lcd_status_message, 3 * (LCD_WIDTH), fmt, args);
va_end(args);
lcd_finishstatus(level > 0);
}

4
Marlin/ultralcd.h

@ -39,7 +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_status_printf_P(const uint8_t level, const char * const fmt, ...);
void lcd_setalertstatuspgm(const char* message);
void lcd_reset_alert_level();
void lcd_kill_screen();
@ -154,7 +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_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); }
inline void lcd_buttons_update() {}
inline void lcd_reset_alert_level() {}
inline bool lcd_detected() { return true; }

Loading…
Cancel
Save