Clear the "Wait for user" message set by M0/M1

See https://github.com/MarlinFirmware/Marlin/issues/10246#issuecomment-377146936
This commit is contained in:
Scott Lahteine 2018-03-29 17:38:25 -05:00
parent d36e950547
commit f5c980f9cf

View File

@ -6240,9 +6240,11 @@ inline void gcode_G92() {
hasS = ms > 0; hasS = ms > 0;
} }
const bool has_message = !hasP && !hasS && args && *args;
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
if (!hasP && !hasS && args && *args) if (has_message)
lcd_setstatus(args, true); lcd_setstatus(args, true);
else { else {
LCD_MESSAGEPGM(MSG_USERWAIT); LCD_MESSAGEPGM(MSG_USERWAIT);
@ -6253,7 +6255,7 @@ inline void gcode_G92() {
#else #else
if (!hasP && !hasS && args && *args) { if (has_message) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOLN(args); SERIAL_ECHOLN(args);
} }
@ -6271,13 +6273,9 @@ inline void gcode_G92() {
} }
else { else {
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
if (lcd_detected()) { if (lcd_detected())
while (wait_for_user) idle();
print_job_timer.isPaused() ? LCD_MESSAGEPGM(WELCOME_MSG) : LCD_MESSAGEPGM(MSG_RESUMING);
}
#else
while (wait_for_user) idle();
#endif #endif
while (wait_for_user) idle();
} }
#if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) #if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT)
@ -6287,6 +6285,12 @@ inline void gcode_G92() {
} }
#endif #endif
#if ENABLED(ULTIPANEL)
if (lcd_detected()) {
print_job_timer.isPaused() ? LCD_MESSAGEPGM(WELCOME_MSG) : LCD_MESSAGEPGM(MSG_RESUMING);
}
#endif
wait_for_user = false; wait_for_user = false;
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);
} }