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:41:04 -05:00
parent b6a55f0891
commit 55e9b85ad6

View file

@ -56,9 +56,11 @@ void GcodeSuite::M0_M1() {
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);
@ -69,7 +71,7 @@ void GcodeSuite::M0_M1() {
#else #else
if (!hasP && !hasS && args && *args) { if (has_message) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOLN(args); SERIAL_ECHOLN(args);
} }
@ -82,18 +84,14 @@ void GcodeSuite::M0_M1() {
stepper.synchronize(); stepper.synchronize();
if (ms > 0) { if (ms > 0) {
ms += previous_move_ms; // wait until this time for a click ms += millis(); // wait until this time for a click
while (PENDING(millis(), ms) && wait_for_user) idle(); while (PENDING(millis(), ms) && wait_for_user) idle();
} }
else { else {
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
if (lcd_detected()) { if (lcd_detected())
while (wait_for_user) idle();
IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);
}
#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)
@ -103,6 +101,12 @@ void GcodeSuite::M0_M1() {
} }
#endif #endif
#if ENABLED(ULTIPANEL)
if (lcd_detected()) {
IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);
}
#endif
wait_for_user = false; wait_for_user = false;
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);
} }