Browse Source

Use ENABLED with DISABLE_[INACTIVE_][XYZ]

Scott Lahteine 8 years ago
parent
commit
4b648793f2
2 changed files with 21 additions and 13 deletions
  1. 4
    4
      Marlin/Marlin_main.cpp
  2. 17
    9
      Marlin/planner.cpp

+ 4
- 4
Marlin/Marlin_main.cpp View File

@@ -6999,16 +6999,16 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
6999 6999
 
7000 7000
   if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time
7001 7001
       && !ignore_stepper_queue && !blocks_queued()) {
7002
-    #if DISABLE_INACTIVE_X == true
7002
+    #if ENABLED(DISABLE_INACTIVE_X)
7003 7003
       disable_x();
7004 7004
     #endif
7005
-    #if DISABLE_INACTIVE_Y == true
7005
+    #if ENABLED(DISABLE_INACTIVE_Y)
7006 7006
       disable_y();
7007 7007
     #endif
7008
-    #if DISABLE_INACTIVE_Z == true
7008
+    #if ENABLED(DISABLE_INACTIVE_Z)
7009 7009
       disable_z();
7010 7010
     #endif
7011
-    #if DISABLE_INACTIVE_E == true
7011
+    #if ENABLED(DISABLE_INACTIVE_E)
7012 7012
       disable_e0();
7013 7013
       disable_e1();
7014 7014
       disable_e2();

+ 17
- 9
Marlin/planner.cpp View File

@@ -421,15 +421,23 @@ void check_axes_activity() {
421 421
       block_index = next_block_index(block_index);
422 422
     }
423 423
   }
424
-  if (DISABLE_X && !axis_active[X_AXIS]) disable_x();
425
-  if (DISABLE_Y && !axis_active[Y_AXIS]) disable_y();
426
-  if (DISABLE_Z && !axis_active[Z_AXIS]) disable_z();
427
-  if (DISABLE_E && !axis_active[E_AXIS]) {
428
-    disable_e0();
429
-    disable_e1();
430
-    disable_e2();
431
-    disable_e3();
432
-  }
424
+  #if ENABLED(DISABLE_X)
425
+    if (!axis_active[X_AXIS]) disable_x();
426
+  #endif
427
+  #if ENABLED(DISABLE_Y)
428
+    if (!axis_active[Y_AXIS]) disable_y();
429
+  #endif
430
+  #if ENABLED(DISABLE_Z)
431
+    if (!axis_active[Z_AXIS]) disable_z();
432
+  #endif
433
+  #if ENABLED(DISABLE_E)
434
+    if (!axis_active[E_AXIS]) {
435
+      disable_e0();
436
+      disable_e1();
437
+      disable_e2();
438
+      disable_e3();
439
+    }
440
+  #endif
433 441
 
434 442
   #if HAS_FAN
435 443
     #ifdef FAN_KICKSTART_TIME

Loading…
Cancel
Save