Explorar el Código

Handle M108 in M1 also with ULTIPANEL

Scott Lahteine hace 8 años
padre
commit
1ba1ec0db9
Se han modificado 1 ficheros con 21 adiciones y 13 borrados
  1. 21
    13
      Marlin/Marlin_main.cpp

+ 21
- 13
Marlin/Marlin_main.cpp Ver fichero

@@ -4431,41 +4431,49 @@ inline void gcode_G92() {
4431 4431
 
4432 4432
     #endif
4433 4433
 
4434
+    #if ENABLED(EMERGENCY_PARSER)
4435
+      wait_for_user = true;
4436
+    #endif
4437
+
4438
+    KEEPALIVE_STATE(PAUSED_FOR_USER);
4439
+
4434 4440
     stepper.synchronize();
4435 4441
     refresh_cmd_timeout();
4436 4442
 
4437 4443
     #if ENABLED(ULTIPANEL)
4438 4444
 
4445
+      #if ENABLED(EMERGENCY_PARSER)
4446
+        #define M1_WAIT_CONDITION (!lcd_clicked() && wait_for_user)
4447
+      #else
4448
+        #define M1_WAIT_CONDITION !lcd_clicked()
4449
+      #endif
4450
+
4439 4451
       if (codenum > 0) {
4440 4452
         codenum += previous_cmd_ms;  // wait until this time for a click
4441
-        KEEPALIVE_STATE(PAUSED_FOR_USER);
4442
-        while (PENDING(millis(), codenum) && !lcd_clicked()) idle();
4453
+        while (PENDING(millis(), codenum) && M1_WAIT_CONDITION) idle();
4443 4454
         lcd_ignore_click(false);
4444 4455
       }
4445 4456
       else if (lcd_detected()) {
4446
-        KEEPALIVE_STATE(PAUSED_FOR_USER);
4447
-        while (!lcd_clicked()) idle();
4457
+        while (M1_WAIT_CONDITION) idle();
4448 4458
       }
4449
-      else return;
4459
+      else goto ExitM1;
4450 4460
 
4451
-      if (IS_SD_PRINTING)
4452
-        LCD_MESSAGEPGM(MSG_RESUMING);
4453
-      else
4454
-        LCD_MESSAGEPGM(WELCOME_MSG);
4461
+      IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);
4455 4462
 
4456 4463
     #else
4457 4464
 
4458
-      KEEPALIVE_STATE(PAUSED_FOR_USER);
4459
-      wait_for_user = true;
4460
-
4461 4465
       if (codenum > 0) {
4462 4466
         codenum += previous_cmd_ms;  // wait until this time for an M108
4463 4467
         while (PENDING(millis(), codenum) && wait_for_user) idle();
4464 4468
       }
4465 4469
       else while (wait_for_user) idle();
4466 4470
 
4467
-      wait_for_user = false;
4471
+    #endif
4468 4472
 
4473
+ExitM1:
4474
+
4475
+    #if ENABLED(EMERGENCY_PARSER)
4476
+      wait_for_user = false;
4469 4477
     #endif
4470 4478
 
4471 4479
     KEEPALIVE_STATE(IN_HANDLER);

Loading…
Cancelar
Guardar