Handle M108 in M1 also with ULTIPANEL
This commit is contained in:
parent
3fcf915808
commit
1ba1ec0db9
|
@ -4431,41 +4431,49 @@ inline void gcode_G92() {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
|
wait_for_user = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
|
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
refresh_cmd_timeout();
|
refresh_cmd_timeout();
|
||||||
|
|
||||||
#if ENABLED(ULTIPANEL)
|
#if ENABLED(ULTIPANEL)
|
||||||
|
|
||||||
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
|
#define M1_WAIT_CONDITION (!lcd_clicked() && wait_for_user)
|
||||||
|
#else
|
||||||
|
#define M1_WAIT_CONDITION !lcd_clicked()
|
||||||
|
#endif
|
||||||
|
|
||||||
if (codenum > 0) {
|
if (codenum > 0) {
|
||||||
codenum += previous_cmd_ms; // wait until this time for a click
|
codenum += previous_cmd_ms; // wait until this time for a click
|
||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
while (PENDING(millis(), codenum) && M1_WAIT_CONDITION) idle();
|
||||||
while (PENDING(millis(), codenum) && !lcd_clicked()) idle();
|
|
||||||
lcd_ignore_click(false);
|
lcd_ignore_click(false);
|
||||||
}
|
}
|
||||||
else if (lcd_detected()) {
|
else if (lcd_detected()) {
|
||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
while (M1_WAIT_CONDITION) idle();
|
||||||
while (!lcd_clicked()) idle();
|
|
||||||
}
|
}
|
||||||
else return;
|
else goto ExitM1;
|
||||||
|
|
||||||
if (IS_SD_PRINTING)
|
IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);
|
||||||
LCD_MESSAGEPGM(MSG_RESUMING);
|
|
||||||
else
|
|
||||||
LCD_MESSAGEPGM(WELCOME_MSG);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
||||||
wait_for_user = true;
|
|
||||||
|
|
||||||
if (codenum > 0) {
|
if (codenum > 0) {
|
||||||
codenum += previous_cmd_ms; // wait until this time for an M108
|
codenum += previous_cmd_ms; // wait until this time for an M108
|
||||||
while (PENDING(millis(), codenum) && wait_for_user) idle();
|
while (PENDING(millis(), codenum) && wait_for_user) idle();
|
||||||
}
|
}
|
||||||
else while (wait_for_user) idle();
|
else while (wait_for_user) idle();
|
||||||
|
|
||||||
wait_for_user = false;
|
#endif
|
||||||
|
|
||||||
|
ExitM1:
|
||||||
|
|
||||||
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
|
wait_for_user = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
KEEPALIVE_STATE(IN_HANDLER);
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
|
|
Loading…
Reference in a new issue