瀏覽代碼

Tweak stepper shutdown test

Scott Lahteine 5 年之前
父節點
當前提交
e25da63721
共有 1 個文件被更改,包括 14 次插入4 次删除
  1. 14
    4
      Marlin/src/MarlinCore.cpp

+ 14
- 4
Marlin/src/MarlinCore.cpp 查看文件

466
   const millis_t ms = millis();
466
   const millis_t ms = millis();
467
 
467
 
468
   // Prevent steppers timing-out in the middle of M600
468
   // Prevent steppers timing-out in the middle of M600
469
-  #define STAY_TEST (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print)
469
+  // unless PAUSE_PARK_NO_STEPPER_TIMEOUT is disabled
470
+  const bool parked_or_ignoring = ignore_stepper_queue ||
471
+     (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print);
470
 
472
 
471
-  if (STAY_TEST || ignore_stepper_queue)
472
-    gcode.reset_stepper_timeout(ms);
473
+  // Reset both the M18/M84 activity timeout and the M85 max 'kill' timeout
474
+  if (parked_or_ignoring) gcode.reset_stepper_timeout(ms);
473
 
475
 
474
   if (gcode.stepper_max_timed_out(ms)) {
476
   if (gcode.stepper_max_timed_out(ms)) {
475
     SERIAL_ERROR_START();
477
     SERIAL_ERROR_START();
477
     kill();
479
     kill();
478
   }
480
   }
479
 
481
 
482
+  // M18 / M94 : Handle steppers inactive time timeout
480
   if (gcode.stepper_inactive_time) {
483
   if (gcode.stepper_inactive_time) {
484
+
481
     static bool already_shutdown_steppers; // = false
485
     static bool already_shutdown_steppers; // = false
486
+
487
+    // Any moves in the planner? Resets both the M18/M84
488
+    // activity timeout and the M85 max 'kill' timeout
482
     if (planner.has_blocks_queued())
489
     if (planner.has_blocks_queued())
483
       gcode.reset_stepper_timeout(ms);
490
       gcode.reset_stepper_timeout(ms);
484
-    else if (!STAY_TEST && !ignore_stepper_queue && gcode.stepper_inactive_timeout()) {
491
+    else if (!parked_or_ignoring && gcode.stepper_inactive_timeout()) {
485
       if (!already_shutdown_steppers) {
492
       if (!already_shutdown_steppers) {
486
         already_shutdown_steppers = true;  // L6470 SPI will consume 99% of free time without this
493
         already_shutdown_steppers = true;  // L6470 SPI will consume 99% of free time without this
494
+
495
+        // Individual axes will be disabled if configured
487
         if (ENABLED(DISABLE_INACTIVE_X)) DISABLE_AXIS_X();
496
         if (ENABLED(DISABLE_INACTIVE_X)) DISABLE_AXIS_X();
488
         if (ENABLED(DISABLE_INACTIVE_Y)) DISABLE_AXIS_Y();
497
         if (ENABLED(DISABLE_INACTIVE_Y)) DISABLE_AXIS_Y();
489
         if (ENABLED(DISABLE_INACTIVE_Z)) DISABLE_AXIS_Z();
498
         if (ENABLED(DISABLE_INACTIVE_Z)) DISABLE_AXIS_Z();
490
         if (ENABLED(DISABLE_INACTIVE_E)) disable_e_steppers();
499
         if (ENABLED(DISABLE_INACTIVE_E)) disable_e_steppers();
500
+
491
         #if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL)
501
         #if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL)
492
           if (ubl.lcd_map_control) {
502
           if (ubl.lcd_map_control) {
493
             ubl.lcd_map_control = false;
503
             ubl.lcd_map_control = false;

Loading…
取消
儲存