Browse Source

🐛 Prevent stepper sleep during long UBL idle (#22137)

Scott Lahteine 4 years ago
parent
commit
6b3dc80b55
No account linked to committer's email address
3 changed files with 10 additions and 11 deletions
  1. 7
    8
      Marlin/src/MarlinCore.cpp
  2. 2
    2
      Marlin/src/MarlinCore.h
  3. 1
    1
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+ 7
- 8
Marlin/src/MarlinCore.cpp View File

@@ -421,19 +421,18 @@ void startOrResumeJob() {
421 421
  *  - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT)
422 422
  *  - Pulse FET_SAFETY_PIN if it exists
423 423
  */
424
-inline void manage_inactivity(const bool ignore_stepper_queue=false) {
424
+inline void manage_inactivity(const bool no_stepper_sleep=false) {
425 425
 
426 426
   queue.get_available_commands();
427 427
 
428 428
   const millis_t ms = millis();
429 429
 
430
-  // Prevent steppers timing-out in the middle of M600
431
-  // unless PAUSE_PARK_NO_STEPPER_TIMEOUT is disabled
432
-  const bool parked_or_ignoring = ignore_stepper_queue
430
+  // Prevent steppers timing-out
431
+  const bool do_reset_timeout = no_stepper_sleep
433 432
                                || TERN0(PAUSE_PARK_NO_STEPPER_TIMEOUT, did_pause_print);
434 433
 
435 434
   // Reset both the M18/M84 activity timeout and the M85 max 'kill' timeout
436
-  if (parked_or_ignoring) gcode.reset_stepper_timeout(ms);
435
+  if (do_reset_timeout) gcode.reset_stepper_timeout(ms);
437 436
 
438 437
   if (gcode.stepper_max_timed_out(ms)) {
439 438
     SERIAL_ERROR_MSG(STR_KILL_INACTIVE_TIME, parser.command_ptr);
@@ -449,7 +448,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
449 448
     // activity timeout and the M85 max 'kill' timeout
450 449
     if (planner.has_blocks_queued())
451 450
       gcode.reset_stepper_timeout(ms);
452
-    else if (!parked_or_ignoring && gcode.stepper_inactive_timeout()) {
451
+    else if (!do_reset_timeout && gcode.stepper_inactive_timeout()) {
453 452
       if (!already_shutdown_steppers) {
454 453
         already_shutdown_steppers = true;  // L6470 SPI will consume 99% of free time without this
455 454
 
@@ -732,14 +731,14 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
732 731
  *  - Update the Průša MMU2
733 732
  *  - Handle Joystick jogging
734 733
  */
735
-void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
734
+void idle(bool no_stepper_sleep/*=false*/) {
736 735
   #if ENABLED(MARLIN_DEV_MODE)
737 736
     static uint16_t idle_depth = 0;
738 737
     if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", idle_depth);
739 738
   #endif
740 739
 
741 740
   // Core Marlin activities
742
-  manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep));
741
+  manage_inactivity(no_stepper_sleep);
743 742
 
744 743
   // Manage Heaters (and Watchdog)
745 744
   thermalManager.manage_heater();

+ 2
- 2
Marlin/src/MarlinCore.h View File

@@ -34,8 +34,8 @@
34 34
 void stop();
35 35
 
36 36
 // Pass true to keep steppers from timing out
37
-void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep=false));
38
-inline void idle_no_sleep() { idle(TERN_(ADVANCED_PAUSE_FEATURE, true)); }
37
+void idle(bool no_stepper_sleep=false);
38
+inline void idle_no_sleep() { idle(true); }
39 39
 
40 40
 #if ENABLED(G38_PROBE_TARGET)
41 41
   extern uint8_t G38_move;          // Flag to tell the ISR that G38 is in progress, and the type

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

@@ -1025,7 +1025,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
1025 1025
       SET_SOFT_ENDSTOP_LOOSE(true);
1026 1026
 
1027 1027
       do {
1028
-        idle();
1028
+        idle_no_sleep();
1029 1029
         new_z = ui.ubl_mesh_value();
1030 1030
         TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset + new_z)); // Move the nozzle as the point is edited
1031 1031
         SERIAL_FLUSH();                                   // Prevent host M105 buffer overrun.

Loading…
Cancel
Save