Ver código fonte

Fix SD finished ExtUI / host action (#17285)

InsanityAutomation 5 anos atrás
pai
commit
3655e240f5
Nenhuma conta vinculada ao e-mail do autor do commit

+ 3
- 2
Marlin/src/MarlinCore.cpp Ver arquivo

@@ -423,7 +423,8 @@ void startOrResumeJob() {
423 423
     switch (card.sdprinting_done_state) {
424 424
 
425 425
       case 1:
426
-        did_state = print_job_timer.duration() < 60 || queue.enqueue_one_P(PSTR("M31"));
426
+        if (print_job_timer.duration() > 60)
427
+          did_state = queue.enqueue_one_P(PSTR("M31"));
427 428
         break;
428 429
 
429 430
       case 2:
@@ -437,7 +438,7 @@ void startOrResumeJob() {
437 438
         break;
438 439
 
439 440
       case 4:                                   // Display "Click to Continue..."
440
-        #if HAS_RESUME_CONTINUE                 // 30 min timeout with LCD, 1 min without
441
+        #if HAS_LEDS_OFF_FLAG                   // 30 min timeout with LCD, 1 min without
441 442
           did_state = queue.enqueue_one_P(
442 443
             print_job_timer.duration() < 60 ? PSTR("M0Q1P1") : PSTR("M0Q1S" TERN(HAS_LCD_MENU, "1800", "60"))
443 444
           );

+ 11
- 11
Marlin/src/gcode/lcd/M0_M1.cpp Ver arquivo

@@ -56,11 +56,11 @@ void GcodeSuite::M0_M1() {
56 56
 
57 57
   planner.synchronize();
58 58
 
59
-  #if HAS_LCD_MENU || HAS_LEDS_OFF_FLAG
59
+  #if HAS_LEDS_OFF_FLAG
60 60
     const bool seenQ = parser.seen('Q');
61
-    #if HAS_LEDS_OFF_FLAG
62
-      if (seenQ) printerEventLEDs.onPrintCompleted();  // Change LED color for Print Completed
63
-    #endif
61
+    if (seenQ) printerEventLEDs.onPrintCompleted();  // Change LED color for Print Completed
62
+  #else
63
+    constexpr bool seenQ = false;
64 64
   #endif
65 65
 
66 66
   #if HAS_LCD_MENU
@@ -75,12 +75,12 @@ void GcodeSuite::M0_M1() {
75 75
     }
76 76
 
77 77
   #elif ENABLED(EXTENSIBLE_UI)
78
-
79
-    if (parser.string_arg)
80
-      ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
81
-    else
82
-      ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
83
-
78
+    if (!seenQ) {
79
+      if (parser.string_arg)
80
+        ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
81
+      else
82
+        ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
83
+    }
84 84
   #else
85 85
 
86 86
     if (parser.string_arg) {
@@ -94,7 +94,7 @@ void GcodeSuite::M0_M1() {
94 94
   wait_for_user = true;
95 95
 
96 96
   #if ENABLED(HOST_PROMPT_SUPPORT)
97
-    host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
97
+    if (!seenQ) host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
98 98
   #endif
99 99
 
100 100
   if (ms > 0) ms += millis();  // wait until this time for a click

+ 1
- 1
Marlin/src/inc/Conditionals_adv.h Ver arquivo

@@ -93,7 +93,7 @@
93 93
 #if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
94 94
   #define HAS_SOFTWARE_ENDSTOPS 1
95 95
 #endif
96
-#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER)
96
+#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS)
97 97
   #define HAS_RESUME_CONTINUE 1
98 98
 #endif
99 99
 

Carregando…
Cancelar
Salvar