Browse Source

🚸 Wait for cooldown in MarlinUI power-off (#23476)

mistic100 3 years ago
parent
commit
2ded50ba3f
3 changed files with 7 additions and 5 deletions
  1. 5
    3
      Marlin/src/lcd/marlinui.cpp
  2. 1
    1
      Marlin/src/lcd/marlinui.h
  3. 1
    1
      Marlin/src/lcd/menu/menu_main.cpp

+ 5
- 3
Marlin/src/lcd/marlinui.cpp View File

@@ -1553,11 +1553,13 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1553 1553
     TERN_(HAS_LCD_MENU, return_to_status());
1554 1554
   }
1555 1555
 
1556
-  #if BOTH(PSU_CONTROL, PS_OFF_CONFIRM)
1556
+  #if BOTH(HAS_LCD_MENU, PSU_CONTROL)
1557
+
1557 1558
     void MarlinUI::poweroff() {
1558
-      queue.inject(F("M81"));
1559
-      goto_previous_screen();
1559
+      queue.inject(F("M81" TERN_(POWER_OFF_WAIT_FOR_COOLDOWN, "S")));
1560
+      return_to_status();
1560 1561
     }
1562
+
1561 1563
   #endif
1562 1564
 
1563 1565
   void MarlinUI::flow_fault() {

+ 1
- 1
Marlin/src/lcd/marlinui.h View File

@@ -373,7 +373,7 @@ public:
373 373
     static void resume_print();
374 374
     static void flow_fault();
375 375
 
376
-    #if BOTH(PSU_CONTROL, PS_OFF_CONFIRM)
376
+    #if BOTH(HAS_LCD_MENU, PSU_CONTROL)
377 377
       static void poweroff();
378 378
     #endif
379 379
 

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp View File

@@ -380,7 +380,7 @@ void menu_main() {
380 380
           GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?")
381 381
         );
382 382
       #else
383
-        GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81"));
383
+        ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff);
384 384
       #endif
385 385
     else
386 386
       GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80"));

Loading…
Cancel
Save