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

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

421
  *  - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT)
421
  *  - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT)
422
  *  - Pulse FET_SAFETY_PIN if it exists
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
   queue.get_available_commands();
426
   queue.get_available_commands();
427
 
427
 
428
   const millis_t ms = millis();
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
                                || TERN0(PAUSE_PARK_NO_STEPPER_TIMEOUT, did_pause_print);
432
                                || TERN0(PAUSE_PARK_NO_STEPPER_TIMEOUT, did_pause_print);
434
 
433
 
435
   // Reset both the M18/M84 activity timeout and the M85 max 'kill' timeout
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
   if (gcode.stepper_max_timed_out(ms)) {
437
   if (gcode.stepper_max_timed_out(ms)) {
439
     SERIAL_ERROR_MSG(STR_KILL_INACTIVE_TIME, parser.command_ptr);
438
     SERIAL_ERROR_MSG(STR_KILL_INACTIVE_TIME, parser.command_ptr);
449
     // activity timeout and the M85 max 'kill' timeout
448
     // activity timeout and the M85 max 'kill' timeout
450
     if (planner.has_blocks_queued())
449
     if (planner.has_blocks_queued())
451
       gcode.reset_stepper_timeout(ms);
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
       if (!already_shutdown_steppers) {
452
       if (!already_shutdown_steppers) {
454
         already_shutdown_steppers = true;  // L6470 SPI will consume 99% of free time without this
453
         already_shutdown_steppers = true;  // L6470 SPI will consume 99% of free time without this
455
 
454
 
732
  *  - Update the Průša MMU2
731
  *  - Update the Průša MMU2
733
  *  - Handle Joystick jogging
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
   #if ENABLED(MARLIN_DEV_MODE)
735
   #if ENABLED(MARLIN_DEV_MODE)
737
     static uint16_t idle_depth = 0;
736
     static uint16_t idle_depth = 0;
738
     if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", idle_depth);
737
     if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", idle_depth);
739
   #endif
738
   #endif
740
 
739
 
741
   // Core Marlin activities
740
   // Core Marlin activities
742
-  manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep));
741
+  manage_inactivity(no_stepper_sleep);
743
 
742
 
744
   // Manage Heaters (and Watchdog)
743
   // Manage Heaters (and Watchdog)
745
   thermalManager.manage_heater();
744
   thermalManager.manage_heater();

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

34
 void stop();
34
 void stop();
35
 
35
 
36
 // Pass true to keep steppers from timing out
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
 #if ENABLED(G38_PROBE_TARGET)
40
 #if ENABLED(G38_PROBE_TARGET)
41
   extern uint8_t G38_move;          // Flag to tell the ISR that G38 is in progress, and the type
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
       SET_SOFT_ENDSTOP_LOOSE(true);
1025
       SET_SOFT_ENDSTOP_LOOSE(true);
1026
 
1026
 
1027
       do {
1027
       do {
1028
-        idle();
1028
+        idle_no_sleep();
1029
         new_z = ui.ubl_mesh_value();
1029
         new_z = ui.ubl_mesh_value();
1030
         TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset + new_z)); // Move the nozzle as the point is edited
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
         SERIAL_FLUSH();                                   // Prevent host M105 buffer overrun.
1031
         SERIAL_FLUSH();                                   // Prevent host M105 buffer overrun.

Loading…
Cancel
Save