Malyan M200 V2 (#17840)

This commit is contained in:
Scott Lahteine
2020-05-04 14:37:43 -05:00
committed by GitHub
parent 1c32f10039
commit 38d1587091
12 changed files with 132 additions and 56 deletions

View File

@@ -97,6 +97,18 @@ void write_to_lcd(const char * const message) {
LCD_SERIAL.Print::write(encoded_message, message_length);
}
// {E:<msg>} is for error states.
void set_lcd_error_P(PGM_P const error, PGM_P const component=nullptr) {
write_to_lcd_P(PSTR("{E:"));
write_to_lcd_P(error);
if (component) {
write_to_lcd_P(PSTR(" "));
write_to_lcd_P(component);
}
write_to_lcd_P(PSTR("}"));
}
/**
* Process an LCD 'C' command.
* These are currently all temperature commands
@@ -465,15 +477,33 @@ namespace ExtUI {
#endif
}
// {E:<msg>} is for error states.
void onPrinterKilled(PGM_P error, PGM_P component) {
write_to_lcd_P(PSTR("{E:"));
write_to_lcd_P(error);
write_to_lcd_P(PSTR(" "));
write_to_lcd_P(component);
write_to_lcd_P("}");
void onPrinterKilled(PGM_P const error, PGM_P const component) {
set_lcd_error_P(error, component);
}
#if HAS_PID_HEATING
void onPidTuning(const result_t rst) {
// Called for temperature PID tuning result
//SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
switch (rst) {
case PID_BAD_EXTRUDER_NUM:
set_lcd_error_P(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
break;
case PID_TEMP_TOO_HIGH:
set_lcd_error_P(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
break;
case PID_TUNING_TIMEOUT:
set_lcd_error_P(GET_TEXT(MSG_PID_TIMEOUT));
break;
case PID_DONE:
set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
break;
}
}
#endif
void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); }
void onPrintTimerPaused() {}
void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); }
@@ -500,10 +530,6 @@ namespace ExtUI {
#if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume() {}
#endif
#if HAS_PID_HEATING
void onPidTuning(const result_t rst) {}
#endif
}
#endif // MALYAN_LCD