Pārlūkot izejas kodu

Move L64XX index_to_axis to progmem (#16697)

Scott Lahteine 5 gadus atpakaļ
vecāks
revīzija
50889c0f94
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam

+ 16
- 16
Marlin/src/MarlinCore.cpp Parādīt failu

@@ -291,7 +291,7 @@ void quickstop_stepper() {
291 291
 }
292 292
 
293 293
 void enable_e_steppers() {
294
-  #define _ENA_E(N) enable_E##N();
294
+  #define _ENA_E(N) ENABLE_AXIS_E##N();
295 295
   REPEAT(E_STEPPERS, _ENA_E)
296 296
 }
297 297
 
@@ -299,28 +299,28 @@ void enable_all_steppers() {
299 299
   #if ENABLED(AUTO_POWER_CONTROL)
300 300
     powerManager.power_on();
301 301
   #endif
302
-  enable_X();
303
-  enable_Y();
304
-  enable_Z();
302
+  ENABLE_AXIS_X();
303
+  ENABLE_AXIS_Y();
304
+  ENABLE_AXIS_Z();
305 305
   enable_e_steppers();
306 306
 }
307 307
 
308 308
 void disable_e_steppers() {
309
-  #define _DIS_E(N) disable_E##N();
309
+  #define _DIS_E(N) DISABLE_AXIS_E##N();
310 310
   REPEAT(E_STEPPERS, _DIS_E)
311 311
 }
312 312
 
313 313
 void disable_e_stepper(const uint8_t e) {
314
-  #define _CASE_DIS_E(N) case N: disable_E##N(); break;
314
+  #define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
315 315
   switch (e) {
316 316
     REPEAT(EXTRUDERS, _CASE_DIS_E)
317 317
   }
318 318
 }
319 319
 
320 320
 void disable_all_steppers() {
321
-  disable_X();
322
-  disable_Y();
323
-  disable_Z();
321
+  DISABLE_AXIS_X();
322
+  DISABLE_AXIS_Y();
323
+  DISABLE_AXIS_Z();
324 324
   disable_e_steppers();
325 325
 }
326 326
 
@@ -461,13 +461,13 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
461 461
       if (!already_shutdown_steppers) {
462 462
         already_shutdown_steppers = true;  // L6470 SPI will consume 99% of free time without this
463 463
         #if ENABLED(DISABLE_INACTIVE_X)
464
-          disable_X();
464
+          DISABLE_AXIS_X();
465 465
         #endif
466 466
         #if ENABLED(DISABLE_INACTIVE_Y)
467
-          disable_Y();
467
+          DISABLE_AXIS_Y();
468 468
         #endif
469 469
         #if ENABLED(DISABLE_INACTIVE_Z)
470
-          disable_Z();
470
+          DISABLE_AXIS_Z();
471 471
         #endif
472 472
         #if ENABLED(DISABLE_INACTIVE_E)
473 473
           disable_e_steppers();
@@ -542,11 +542,11 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
542 542
       #if ENABLED(SWITCHING_EXTRUDER)
543 543
         bool oldstatus;
544 544
         switch (active_extruder) {
545
-          default: oldstatus = E0_ENABLE_READ(); enable_E0(); break;
545
+          default: oldstatus = E0_ENABLE_READ(); ENABLE_AXIS_E0(); break;
546 546
           #if E_STEPPERS > 1
547
-            case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break;
547
+            case 2: case 3: oldstatus = E1_ENABLE_READ(); ENABLE_AXIS_E1(); break;
548 548
             #if E_STEPPERS > 2
549
-              case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break;
549
+              case 4: case 5: oldstatus = E2_ENABLE_READ(); ENABLE_AXIS_E2(); break;
550 550
             #endif // E_STEPPERS > 2
551 551
           #endif // E_STEPPERS > 1
552 552
         }
@@ -554,7 +554,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
554 554
         bool oldstatus;
555 555
         switch (active_extruder) {
556 556
           default:
557
-          #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break;
557
+          #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); ENABLE_AXIS_E##N(); break;
558 558
           REPEAT(E_STEPPERS, _CASE_EN);
559 559
         }
560 560
       #endif

+ 1
- 1
Marlin/src/feature/babystep.cpp Parādīt failu

@@ -78,7 +78,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
78 78
   #endif
79 79
 
80 80
   #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
81
-    #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: enable_X(); break; case Y_AXIS: enable_Y(); break; case Z_AXIS: enable_Z(); break; default: break; } }while(0)
81
+    #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: ENABLE_AXIS_X(); break; case Y_AXIS: ENABLE_AXIS_Y(); break; case Z_AXIS: ENABLE_AXIS_Z(); break; default: break; } }while(0)
82 82
   #else
83 83
     #define BSA_ENABLE(AXIS) NOOP
84 84
   #endif

+ 8
- 8
Marlin/src/feature/prusa_MMU2/mmu2.cpp Parādīt failu

@@ -448,7 +448,7 @@ void MMU2::tool_change(uint8_t index) {
448 448
 
449 449
   if (index != extruder) {
450 450
 
451
-    disable_E0();
451
+    DISABLE_AXIS_E0();
452 452
     ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
453 453
 
454 454
     command(MMU_CMD_T0 + index);
@@ -459,7 +459,7 @@ void MMU2::tool_change(uint8_t index) {
459 459
     extruder = index; //filament change is finished
460 460
     active_extruder = 0;
461 461
 
462
-    enable_E0();
462
+    ENABLE_AXIS_E0();
463 463
 
464 464
     SERIAL_ECHO_START();
465 465
     SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder));
@@ -497,13 +497,13 @@ void MMU2::tool_change(const char* special) {
497 497
       case 'x': {
498 498
         planner.synchronize();
499 499
         uint8_t index = mmu2_choose_filament();
500
-        disable_E0();
500
+        DISABLE_AXIS_E0();
501 501
         command(MMU_CMD_T0 + index);
502 502
         manage_response(true, true);
503 503
         command(MMU_CMD_C0);
504 504
         mmu_loop();
505 505
 
506
-        enable_E0();
506
+        ENABLE_AXIS_E0();
507 507
         extruder = index;
508 508
         active_extruder = 0;
509 509
       } break;
@@ -697,7 +697,7 @@ void MMU2::filament_runout() {
697 697
 
698 698
     LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);
699 699
 
700
-    enable_E0();
700
+    ENABLE_AXIS_E0();
701 701
     current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
702 702
     line_to_current_position(2500 / 60);
703 703
     planner.synchronize();
@@ -731,7 +731,7 @@ void MMU2::filament_runout() {
731 731
 
732 732
     BUZZ(200, 404);
733 733
 
734
-    disable_E0();
734
+    DISABLE_AXIS_E0();
735 735
 
736 736
     return true;
737 737
   }
@@ -776,7 +776,7 @@ void MMU2::filament_runout() {
776 776
   void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {
777 777
 
778 778
     planner.synchronize();
779
-    enable_E0();
779
+    ENABLE_AXIS_E0();
780 780
 
781 781
     const E_Step* step = sequence;
782 782
 
@@ -794,7 +794,7 @@ void MMU2::filament_runout() {
794 794
       step++;
795 795
     }
796 796
 
797
-    disable_E0();
797
+    DISABLE_AXIS_E0();
798 798
   }
799 799
 
800 800
 #endif // HAS_LCD_MENU && MMU2_MENUS

+ 1
- 3
Marlin/src/gcode/calibrate/G33.cpp Parādīt failu

@@ -439,7 +439,6 @@ void GcodeSuite::G33() {
439 439
              _opposite_results    = (_4p_calibration && !towers_set) || probe_points >= 3,
440 440
              _endstop_results     = probe_points != 1 && probe_points != -1 && probe_points != 0,
441 441
              _angle_results       = probe_points >= 3 && towers_set;
442
-  static const char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
443 442
   int8_t iterations = 0;
444 443
   float test_precision,
445 444
         zero_std_dev = (verbose_level ? 999.0f : 0.0f), // 0.0 in dry-run mode : forced end
@@ -625,8 +624,7 @@ void GcodeSuite::G33() {
625 624
           sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min));
626 625
         ui.set_status(mess);
627 626
         print_calibration_settings(_endstop_results, _angle_results);
628
-        serialprintPGM(save_message);
629
-        SERIAL_EOL();
627
+        SERIAL_ECHOLNPGM("Save with M500 and/or copy to Configuration.h");
630 628
       }
631 629
       else { // !end iterations
632 630
         char mess[15];

+ 6
- 6
Marlin/src/gcode/control/M17_M18_M84.cpp Parādīt failu

@@ -34,9 +34,9 @@
34 34
  */
35 35
 void GcodeSuite::M17() {
36 36
   if (parser.seen("XYZE")) {
37
-    if (parser.seen('X')) enable_X();
38
-    if (parser.seen('Y')) enable_Y();
39
-    if (parser.seen('Z')) enable_Z();
37
+    if (parser.seen('X')) ENABLE_AXIS_X();
38
+    if (parser.seen('Y')) ENABLE_AXIS_Y();
39
+    if (parser.seen('Z')) ENABLE_AXIS_Z();
40 40
     #if HAS_E_STEPPER_ENABLE
41 41
       if (parser.seen('E')) enable_e_steppers();
42 42
     #endif
@@ -57,9 +57,9 @@ void GcodeSuite::M18_M84() {
57 57
   else {
58 58
     if (parser.seen("XYZE")) {
59 59
       planner.synchronize();
60
-      if (parser.seen('X')) disable_X();
61
-      if (parser.seen('Y')) disable_Y();
62
-      if (parser.seen('Z')) disable_Z();
60
+      if (parser.seen('X')) DISABLE_AXIS_X();
61
+      if (parser.seen('Y')) DISABLE_AXIS_Y();
62
+      if (parser.seen('Z')) DISABLE_AXIS_Z();
63 63
       #if HAS_E_STEPPER_ENABLE
64 64
         if (parser.seen('E')) disable_e_steppers();
65 65
       #endif

+ 49
- 55
Marlin/src/libs/L64XX/L64XX_Marlin.cpp Parādīt failu

@@ -39,39 +39,40 @@ L64XX_Marlin L64xxManager;
39 39
 
40 40
 void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); }
41 41
 
42
-char L64XX_Marlin::index_to_axis[MAX_L64XX][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "Z4", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7" };
42
+static const char str_X[] PROGMEM = "X ",  str_Y[] PROGMEM = "Y ",  str_Z[] PROGMEM = "Z ",
43
+                 str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2",
44
+                 str_Z2[] PROGMEM = "Z2", str_Z3[] PROGMEM = "Z3", str_Z4[] PROGMEM = "Z4",
45
+                 str_E0[] PROGMEM = "E0", str_E1[] PROGMEM = "E1",
46
+                 str_E2[] PROGMEM = "E2", str_E3[] PROGMEM = "E3",
47
+                 str_E4[] PROGMEM = "E4", str_E5[] PROGMEM = "E5",
48
+                 str_E6[] PROGMEM = "E6", str_E7[] PROGMEM = "E7"
49
+                 ;
50
+
51
+PGM_P const L64XX_Marlin::index_to_axis[] PROGMEM = {
52
+  str_X, str_Y, str_Z, str_X2, str_Y2, str_Z2, str_Z3, str_Z4,
53
+  str_E0, str_E1, str_E2, str_E3, str_E4, str_E5, str_E6, str_E7
54
+};
43 55
 
44 56
 #define DEBUG_OUT ENABLED(L6470_CHITCHAT)
45 57
 #include "../../core/debug_out.h"
46 58
 
47 59
 uint8_t L64XX_Marlin::dir_commands[MAX_L64XX];  // array to hold direction command for each driver
48 60
 
49
-uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { (INVERT_X_DIR),                         //  0 X
50
-                                                  (INVERT_Y_DIR),                         //  1 Y
51
-                                                  (INVERT_Z_DIR),                         //  2 Z
52
-                                                  #if ENABLED(X_DUAL_STEPPER_DRIVERS)     //  3 X2
53
-                                                    (INVERT_X_DIR) ^ (INVERT_X2_VS_X_DIR),
54
-                                                  #else
55
-                                                    (INVERT_X_DIR),
56
-                                                  #endif
57
-                                                  #if ENABLED(Y_DUAL_STEPPER_DRIVERS)     //  4 Y2
58
-                                                    (INVERT_Y_DIR) ^ (INVERT_Y2_VS_Y_DIR),
59
-                                                  #else
60
-                                                    (INVERT_Y_DIR),
61
-                                                  #endif
62
-                                                  (INVERT_Z_DIR),                         //  5 Z2
63
-                                                  (INVERT_Z_DIR),                         //  6 Z3
64
-                                                  (INVERT_Z_DIR),                         //  7 Z4
65
-
66
-                                                  (INVERT_E0_DIR),                        //  8 E0
67
-                                                  (INVERT_E1_DIR),                        //  9 E1
68
-                                                  (INVERT_E2_DIR),                        // 10 E2
69
-                                                  (INVERT_E3_DIR),                        // 11 E3
70
-                                                  (INVERT_E4_DIR),                        // 12 E4
71
-                                                  (INVERT_E5_DIR),                        // 13 E5
72
-                                                  (INVERT_E6_DIR),                        // 14 E6
73
-                                                  (INVERT_E7_DIR)                         // 15 E7
74
-                                                };
61
+const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = {
62
+  INVERT_X_DIR, INVERT_Y_DIR, INVERT_Z_DIR
63
+  , (INVERT_X_DIR)                            // X2
64
+    #if ENABLED(X_DUAL_STEPPER_DRIVERS)
65
+      ^ (INVERT_X2_VS_X_DIR)
66
+    #endif
67
+  , (INVERT_Y_DIR)                            // Y2
68
+    #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
69
+      ^ (INVERT_Y2_VS_Y_DIR)
70
+    #endif
71
+  , INVERT_Z_DIR, INVERT_Z_DIR, INVERT_Z_DIR  // Z2,Z3,Z4
72
+
73
+  , INVERT_E0_DIR, INVERT_E1_DIR, INVERT_E2_DIR, INVERT_E3_DIR
74
+  , INVERT_E4_DIR, INVERT_E5_DIR, INVERT_E6_DIR, INVERT_E7_DIR
75
+};
75 76
 
76 77
 volatile uint8_t L64XX_Marlin::spi_abort = false;
77 78
 uint8_t L64XX_Marlin::spi_active = false;
@@ -379,35 +380,27 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
379 380
     found_displacement = true;
380 381
     displacement = _displacement;
381 382
     uint8_t axis_offset = parser.byteval('J');
382
-    axis_mon[0][0] = axis_codes[i];   // axis ASCII value (target character)
383
+    axis_mon[0][0] = axis_codes[i];         // Axis first character, one of XYZE
384
+    const bool single_or_e = axis_offset >= 2 || axis_mon[0][0] == 'E',
385
+               one_or_more = !single_or_e && axis_offset == 0;
383 386
     uint8_t driver_count_local = 0;         // Can't use "driver_count" directly as a subscript because it's passed by reference
384
-    if (axis_offset >= 2 || axis_mon[0][0] == 'E') {  // Single axis, E0, or E1
385
-      axis_mon[0][1] = axis_offset + '0';
386
-      for (j = 0; j < MAX_L64XX; j++) {       // See how many drivers on this axis
387
-        const char * const str = index_to_axis[j];
388
-        if (axis_mon[0][0] == str[0]) {
389
-          char * const mon = axis_mon[driver_count_local];
390
-          mon[0] = str[0];
391
-          mon[1] = str[1];
392
-          mon[2] = str[2];   // append end of string
393
-          axis_index[driver_count_local] = (L64XX_axis_t)j;        // set axis index
394
-          driver_count_local++;
395
-        }
396
-      }
397
-    }
398
-    else if (axis_offset == 0) {              // One or more axes
399
-      for (j = 0; j < MAX_L64XX; j++) {       // See how many drivers on this axis
400
-        const char * const str = index_to_axis[j];
401
-        if (axis_mon[0][0] == str[0]) {
402
-          char * const mon = axis_mon[driver_count_local];
403
-          mon[0] = str[0];
404
-          mon[1] = str[1];
405
-          mon[2] = str[2];   // append end of string
406
-          axis_index[driver_count_local] = (L64XX_axis_t)j;        // set axis index
387
+    if (single_or_e)                        // Single axis, E0, or E1
388
+      axis_mon[0][1] = axis_offset + '0';   // Index given by 'J' parameter
389
+
390
+    if (single_or_e || one_or_more) {
391
+      for (j = 0; j < MAX_L64XX; j++) {     // Count up the drivers on this axis
392
+        PGM_P str = (PGM_P)pgm_read_ptr(&index_to_axis[j]); // Get a PGM_P from progmem
393
+        const char c = pgm_read_byte(str);                  // Get a char from progmem
394
+        if (axis_mon[0][0] == c) {          // For each stepper on this axis...
395
+          char *mon = axis_mon[driver_count_local];
396
+          *mon++ = c;                        // Copy the 3 letter axis name
397
+          *mon++ = pgm_read_byte(&str[1]);   //  to the axis_mon array
398
+          *mon   = pgm_read_byte(&str[2]);
399
+          axis_index[driver_count_local] = (L64XX_axis_t)j; // And store the L64XX axis index
407 400
           driver_count_local++;
408 401
         }
409 402
       }
410
-      driver_count = driver_count_local;
403
+      if (one_or_more) driver_count = driver_count_local;
411 404
     }
412 405
     break; // only take first axis found
413 406
   }
@@ -494,8 +487,8 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
494 487
   for (uint8_t k = 0; k < driver_count; k++) {
495 488
     uint8_t not_found = true;
496 489
     for (j = 1; j <= L64XX::chain[0]; j++) {
497
-      const char * const ind_axis = index_to_axis[L64XX::chain[j]];
498
-      if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver
490
+      PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[L64XX::chain[j]]);
491
+      if (pgm_read_byte(&str[0]) == axis_mon[k][0] && pgm_read_byte(&str[1]) == axis_mon[k][1]) { // See if a L6470 driver
499 492
         not_found = false;
500 493
         break;
501 494
       }
@@ -724,7 +717,8 @@ void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*
724 717
   };
725 718
 
726 719
   void L64XX_Marlin::append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err/*=nullptr*/) {
727
-    p += sprintf_P(p, PSTR("Stepper %c%c "), index_to_axis[stepper_index][0], index_to_axis[stepper_index][1]);
720
+    PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[stepper_index]);
721
+    p += sprintf_P(p, PSTR("Stepper %c%c "), pgm_read_byte(&str[0]), pgm_read_byte(&str[1]));
728 722
     if (err) p += sprintf_P(p, err);
729 723
   }
730 724
 

+ 3
- 3
Marlin/src/libs/L64XX/L64XX_Marlin.h Parādīt failu

@@ -39,9 +39,10 @@ enum L64XX_axis_t : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E
39 39
 
40 40
 class L64XX_Marlin : public L64XXHelper {
41 41
 public:
42
-  static char index_to_axis[MAX_L64XX][3];
42
+  static PGM_P const index_to_axis[MAX_L64XX];
43
+
44
+  static const uint8_t index_to_dir[MAX_L64XX];
43 45
 
44
-  static uint8_t index_to_dir[MAX_L64XX];
45 46
   static uint8_t dir_commands[MAX_L64XX];
46 47
 
47 48
   // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer
@@ -69,7 +70,6 @@ public:
69 70
 
70 71
   static void transfer(uint8_t L6470_buf[], const uint8_t length);
71 72
 
72
-  //static char* index_to_axis(const uint8_t index);
73 73
   static void say_axis(const L64XX_axis_t axis, const uint8_t label=true);
74 74
   #if ENABLED(L6470_CHITCHAT)
75 75
     static void error_status_decode(

+ 20
- 20
Marlin/src/module/planner.cpp Parādīt failu

@@ -1252,13 +1252,13 @@ void Planner::check_axes_activity() {
1252 1252
   // Disable inactive axes
1253 1253
   //
1254 1254
   #if ENABLED(DISABLE_X)
1255
-    if (!axis_active.x) disable_X();
1255
+    if (!axis_active.x) DISABLE_AXIS_X();
1256 1256
   #endif
1257 1257
   #if ENABLED(DISABLE_Y)
1258
-    if (!axis_active.y) disable_Y();
1258
+    if (!axis_active.y) DISABLE_AXIS_Y();
1259 1259
   #endif
1260 1260
   #if ENABLED(DISABLE_Z)
1261
-    if (!axis_active.z) disable_Z();
1261
+    if (!axis_active.z) DISABLE_AXIS_Z();
1262 1262
   #endif
1263 1263
   #if ENABLED(DISABLE_E)
1264 1264
     if (!axis_active.e) disable_e_steppers();
@@ -1905,29 +1905,29 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1905 1905
   // Enable active axes
1906 1906
   #if CORE_IS_XY
1907 1907
     if (block->steps.a || block->steps.b) {
1908
-      enable_X();
1909
-      enable_Y();
1908
+      ENABLE_AXIS_X();
1909
+      ENABLE_AXIS_Y();
1910 1910
     }
1911 1911
     #if DISABLED(Z_LATE_ENABLE)
1912
-      if (block->steps.z) enable_Z();
1912
+      if (block->steps.z) ENABLE_AXIS_Z();
1913 1913
     #endif
1914 1914
   #elif CORE_IS_XZ
1915 1915
     if (block->steps.a || block->steps.c) {
1916
-      enable_X();
1917
-      enable_Z();
1916
+      ENABLE_AXIS_X();
1917
+      ENABLE_AXIS_Z();
1918 1918
     }
1919
-    if (block->steps.y) enable_Y();
1919
+    if (block->steps.y) ENABLE_AXIS_Y();
1920 1920
   #elif CORE_IS_YZ
1921 1921
     if (block->steps.b || block->steps.c) {
1922
-      enable_Y();
1923
-      enable_Z();
1922
+      ENABLE_AXIS_Y();
1923
+      ENABLE_AXIS_Z();
1924 1924
     }
1925
-    if (block->steps.x) enable_X();
1925
+    if (block->steps.x) ENABLE_AXIS_X();
1926 1926
   #else
1927
-    if (block->steps.x) enable_X();
1928
-    if (block->steps.y) enable_Y();
1927
+    if (block->steps.x) ENABLE_AXIS_X();
1928
+    if (block->steps.y) ENABLE_AXIS_Y();
1929 1929
     #if DISABLED(Z_LATE_ENABLE)
1930
-      if (block->steps.z) enable_Z();
1930
+      if (block->steps.z) ENABLE_AXIS_Z();
1931 1931
     #endif
1932 1932
   #endif
1933 1933
 
@@ -1945,27 +1945,27 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1945 1945
 
1946 1946
         #if HAS_DUPLICATION_MODE
1947 1947
           if (extruder_duplication_enabled && extruder == 0) {
1948
-            enable_E1();
1948
+            ENABLE_AXIS_E1();
1949 1949
             g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
1950 1950
           }
1951 1951
         #endif
1952 1952
 
1953 1953
         #define ENABLE_ONE_E(N) do{ \
1954 1954
           if (extruder == N) { \
1955
-            enable_E##N(); \
1955
+            ENABLE_AXIS_E##N(); \
1956 1956
             g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \
1957 1957
           } \
1958 1958
           else if (!g_uc_extruder_last_move[N]) \
1959
-            disable_E##N(); \
1959
+            DISABLE_AXIS_E##N(); \
1960 1960
         }while(0);
1961 1961
 
1962 1962
       #else
1963 1963
 
1964
-        #define ENABLE_ONE_E(N) enable_E##N();
1964
+        #define ENABLE_ONE_E(N) ENABLE_AXIS_E##N();
1965 1965
 
1966 1966
       #endif
1967 1967
 
1968
-      REPEAT(EXTRUDERS, ENABLE_ONE_E);
1968
+      REPEAT(EXTRUDERS, ENABLE_ONE_E); // (ENABLE_ONE_E must end with semicolon)
1969 1969
     }
1970 1970
   #endif // EXTRUDERS
1971 1971
 

+ 1
- 1
Marlin/src/module/probe.cpp Parādīt failu

@@ -251,7 +251,7 @@ xyz_pos_t probe_offset; // Initialized by settings.load()
251 251
     #if ENABLED(PROBING_STEPPERS_OFF)
252 252
       disable_e_steppers();
253 253
       #if NONE(DELTA, HOME_AFTER_DEACTIVATE)
254
-        disable_X(); disable_Y();
254
+        DISABLE_AXIS_X(); DISABLE_AXIS_Y();
255 255
       #endif
256 256
     #endif
257 257
     if (p) safe_delay(

+ 8
- 8
Marlin/src/module/stepper.cpp Parādīt failu

@@ -1927,7 +1927,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
1927 1927
         // If delayed Z enable, enable it now. This option will severely interfere with
1928 1928
         // timing between pulses when chaining motion between blocks, and it could lead
1929 1929
         // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!!
1930
-        if (current_block->steps.z) enable_Z();
1930
+        if (current_block->steps.z) ENABLE_AXIS_Z();
1931 1931
       #endif
1932 1932
 
1933 1933
       // Mark the time_nominal as not calculated yet
@@ -2215,12 +2215,12 @@ void Stepper::init() {
2215 2215
 
2216 2216
   #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT()
2217 2217
   #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW)
2218
-  #define _DISABLE(AXIS) disable_## AXIS()
2218
+  #define _DISABLE_AXIS(AXIS) DISABLE_AXIS_## AXIS()
2219 2219
 
2220 2220
   #define AXIS_INIT(AXIS, PIN) \
2221 2221
     _STEP_INIT(AXIS); \
2222 2222
     _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \
2223
-    _DISABLE(AXIS)
2223
+    _DISABLE_AXIS(AXIS)
2224 2224
 
2225 2225
   #define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E)
2226 2226
 
@@ -2437,7 +2437,7 @@ void Stepper::report_positions() {
2437 2437
   #endif
2438 2438
   #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP))
2439 2439
 
2440
-  #define _ENABLE(AXIS) enable_## AXIS()
2440
+  #define _ENABLE_AXIS(AXIS) ENABLE_AXIS_## AXIS()
2441 2441
   #define _READ_DIR(AXIS) AXIS ##_DIR_READ()
2442 2442
   #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR
2443 2443
   #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
@@ -2460,7 +2460,7 @@ void Stepper::report_positions() {
2460 2460
 
2461 2461
   #define BABYSTEP_AXIS(AXIS, INVERT, DIR) {            \
2462 2462
       const uint8_t old_dir = _READ_DIR(AXIS);          \
2463
-      _ENABLE(AXIS);                                    \
2463
+      _ENABLE_AXIS(AXIS);                                    \
2464 2464
       DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY);              \
2465 2465
       _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT);   \
2466 2466
       DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY);              \
@@ -2523,9 +2523,9 @@ void Stepper::report_positions() {
2523 2523
 
2524 2524
           const bool z_direction = direction ^ BABYSTEP_INVERT_Z;
2525 2525
 
2526
-          enable_X();
2527
-          enable_Y();
2528
-          enable_Z();
2526
+          ENABLE_AXIS_X();
2527
+          ENABLE_AXIS_Y();
2528
+          ENABLE_AXIS_Z();
2529 2529
 
2530 2530
           #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0
2531 2531
             DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY);

+ 50
- 0
Marlin/src/module/stepper/L64xx.h Parādīt failu

@@ -55,6 +55,9 @@
55 55
     #define X_DIR_INIT()        NOOP
56 56
     #define X_DIR_WRITE(STATE)  L64XX_DIR_WRITE(X, STATE)
57 57
     #define X_DIR_READ()        (stepper##X.getStatus() & STATUS_DIR);
58
+    #if AXIS_DRIVER_TYPE_X(L6470)
59
+      #define DISABLE_STEPPER_X() stepperX.free()
60
+    #endif
58 61
   #endif
59 62
 #endif
60 63
 
@@ -72,6 +75,9 @@
72 75
     #define Y_DIR_INIT()        NOOP
73 76
     #define Y_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Y, STATE)
74 77
     #define Y_DIR_READ()        (stepper##Y.getStatus() & STATUS_DIR);
78
+    #if AXIS_DRIVER_TYPE_Y(L6470)
79
+      #define DISABLE_STEPPER_Y() stepperY.free()
80
+    #endif
75 81
   #endif
76 82
 #endif
77 83
 
@@ -89,6 +95,9 @@
89 95
     #define Z_DIR_INIT()        NOOP
90 96
     #define Z_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Z, STATE)
91 97
     #define Z_DIR_READ()        (stepper##Z.getStatus() & STATUS_DIR);
98
+    #if AXIS_DRIVER_TYPE_Z(L6470)
99
+      #define DISABLE_STEPPER_Z() stepperZ.free()
100
+    #endif
92 101
   #endif
93 102
 #endif
94 103
 
@@ -109,6 +118,10 @@
109 118
   #endif
110 119
 #endif
111 120
 
121
+#if AXIS_DRIVER_TYPE_X2(L6470)
122
+  #define DISABLE_STEPPER_X2() stepperX2.free()
123
+#endif
124
+
112 125
 // Y2 Stepper
113 126
 #if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2)
114 127
   extern L64XX_CLASS(Y2)         stepperY2;
@@ -126,6 +139,10 @@
126 139
   #endif
127 140
 #endif
128 141
 
142
+#if AXIS_DRIVER_TYPE_Y2(L6470)
143
+  #define DISABLE_STEPPER_Y2() stepperY2.free()
144
+#endif
145
+
129 146
 // Z2 Stepper
130 147
 #if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2)
131 148
   extern L64XX_CLASS(Z2)         stepperZ2;
@@ -143,6 +160,10 @@
143 160
   #endif
144 161
 #endif
145 162
 
163
+#if AXIS_DRIVER_TYPE_Z2(L6470)
164
+  #define DISABLE_STEPPER_Z2() stepperZ2.free()
165
+#endif
166
+
146 167
 // Z3 Stepper
147 168
 #if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3)
148 169
   extern L64XX_CLASS(Z3)         stepperZ3;
@@ -160,6 +181,10 @@
160 181
   #endif
161 182
 #endif
162 183
 
184
+#if AXIS_DRIVER_TYPE_Z3(L6470)
185
+  #define DISABLE_STEPPER_Z3() stepperZ3.free()
186
+#endif
187
+
163 188
 // Z4 Stepper
164 189
 #if HAS_Z4_ENABLE && AXIS_IS_L64XX(Z4)
165 190
   extern L64XX_CLASS(Z4)         stepperZ4;
@@ -177,6 +202,10 @@
177 202
   #endif
178 203
 #endif
179 204
 
205
+#if AXIS_DRIVER_TYPE_Z4(L6470)
206
+  #define DISABLE_STEPPER_Z4() stepperZ4.free()
207
+#endif
208
+
180 209
 // E0 Stepper
181 210
 #if AXIS_IS_L64XX(E0)
182 211
   extern L64XX_CLASS(E0)         stepperE0;
@@ -191,6 +220,9 @@
191 220
     #define E0_DIR_INIT()        NOOP
192 221
     #define E0_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E0, STATE)
193 222
     #define E0_DIR_READ()        (stepper##E0.getStatus() & STATUS_DIR);
223
+    #if AXIS_DRIVER_TYPE_E0(L6470)
224
+      #define DISABLE_STEPPER_E0() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
225
+    #endif
194 226
   #endif
195 227
 #endif
196 228
 
@@ -208,6 +240,9 @@
208 240
     #define E1_DIR_INIT()        NOOP
209 241
     #define E1_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E1, STATE)
210 242
     #define E1_DIR_READ()        (stepper##E1.getStatus() & STATUS_DIR);
243
+    #if AXIS_DRIVER_TYPE_E1(L6470)
244
+      #define DISABLE_STEPPER_E1() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
245
+    #endif
211 246
   #endif
212 247
 #endif
213 248
 
@@ -225,6 +260,9 @@
225 260
     #define E2_DIR_INIT()        NOOP
226 261
     #define E2_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E2, STATE)
227 262
     #define E2_DIR_READ()        (stepper##E2.getStatus() & STATUS_DIR);
263
+    #if AXIS_DRIVER_TYPE_E2(L6470)
264
+      #define DISABLE_STEPPER_E2() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
265
+    #endif
228 266
   #endif
229 267
 #endif
230 268
 
@@ -259,6 +297,9 @@
259 297
     #define E4_DIR_INIT()        NOOP
260 298
     #define E4_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E4, STATE)
261 299
     #define E4_DIR_READ()        (stepper##E4.getStatus() & STATUS_DIR);
300
+    #if AXIS_DRIVER_TYPE_E4(L6470)
301
+      #define DISABLE_STEPPER_E4() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
302
+    #endif
262 303
   #endif
263 304
 #endif
264 305
 
@@ -276,6 +317,9 @@
276 317
     #define E5_DIR_INIT()        NOOP
277 318
     #define E5_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E5, STATE)
278 319
     #define E5_DIR_READ()        (stepper##E5.getStatus() & STATUS_DIR);
320
+    #if AXIS_DRIVER_TYPE_E5(L6470)
321
+      #define DISABLE_STEPPER_E5() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
322
+    #endif
279 323
   #endif
280 324
 #endif
281 325
 
@@ -293,6 +337,9 @@
293 337
     #define E6_DIR_INIT()        NOOP
294 338
     #define E6_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E6, STATE)
295 339
     #define E6_DIR_READ()        (stepper##E6.getStatus() & STATUS_DIR);
340
+    #if AXIS_DRIVER_TYPE_E6(L6470)
341
+      #define DISABLE_STEPPER_E6() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0)
342
+    #endif
296 343
   #endif
297 344
 #endif
298 345
 
@@ -310,5 +357,8 @@
310 357
     #define E7_DIR_INIT()        NOOP
311 358
     #define E7_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E7, STATE)
312 359
     #define E7_DIR_READ()        (stepper##E7.getStatus() & STATUS_DIR);
360
+    #if AXIS_DRIVER_TYPE_E7(L6470)
361
+      #define DISABLE_STEPPER_E7() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0)
362
+    #endif
313 363
   #endif
314 364
 #endif

+ 335
- 243
Marlin/src/module/stepper/indirection.h Parādīt failu

@@ -594,320 +594,412 @@ void reset_stepper_drivers();    // Called by settings.load / settings.reset
594 594
 #endif
595 595
 
596 596
 //
597
-// X, Y, Z Stepper enable / disable
597
+// Individual stepper enable / disable macros
598 598
 //
599
-#if AXIS_DRIVER_TYPE_X(L6470)
600
-  extern L6470 stepperX;
601
-  #define X_enable()  NOOP
602
-  #define X_disable() stepperX.free()
603
-#elif HAS_X_ENABLE
604
-  #define X_enable()  X_ENABLE_WRITE( X_ENABLE_ON)
605
-  #define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON)
606
-#else
607
-  #define X_enable()  NOOP
608
-  #define X_disable() NOOP
609
-#endif
610 599
 
611
-#if AXIS_DRIVER_TYPE_X2(L6470)
612
-  extern L6470 stepperX2;
613
-  #define X2_enable()  NOOP
614
-  #define X2_disable() stepperX2.free()
615
-#elif HAS_X2_ENABLE
616
-  #define X2_enable()  X2_ENABLE_WRITE( X_ENABLE_ON)
617
-  #define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON)
618
-#else
619
-  #define X2_enable()  NOOP
620
-  #define X2_disable() NOOP
600
+#ifndef ENABLE_STEPPER_X
601
+  #if HAS_X_ENABLE
602
+    #define  ENABLE_STEPPER_X() X_ENABLE_WRITE( X_ENABLE_ON)
603
+  #else
604
+    #define  ENABLE_STEPPER_X() NOOP
605
+  #endif
621 606
 #endif
622
-
623
-#define  enable_X() do{ X_enable(); X2_enable(); }while(0)
624
-#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0)
625
-
626
-#if AXIS_DRIVER_TYPE_Y(L6470)
627
-  extern L6470 stepperY;
628
-  #define Y_enable()  NOOP
629
-  #define Y_disable() stepperY.free()
630
-#elif HAS_Y_ENABLE
631
-  #define Y_enable()  Y_ENABLE_WRITE( Y_ENABLE_ON)
632
-  #define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON)
633
-#else
634
-  #define Y_enable()  NOOP
635
-  #define Y_disable() NOOP
607
+#ifndef DISABLE_STEPPER_X
608
+  #if HAS_X_ENABLE
609
+    #define DISABLE_STEPPER_X() X_ENABLE_WRITE(!X_ENABLE_ON)
610
+  #else
611
+    #define DISABLE_STEPPER_X() NOOP
612
+  #endif
636 613
 #endif
637 614
 
638
-#if AXIS_DRIVER_TYPE_Y2(L6470)
639
-  extern L6470 stepperY2;
640
-  #define Y2_enable()  NOOP
641
-  #define Y2_disable() stepperY2.free()
642
-#elif HAS_Y2_ENABLE
643
-  #define Y2_enable()  Y2_ENABLE_WRITE( Y_ENABLE_ON)
644
-  #define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
645
-#else
646
-  #define Y2_enable()  NOOP
647
-  #define Y2_disable() NOOP
615
+#ifndef ENABLE_STEPPER_X2
616
+  #if HAS_X2_ENABLE
617
+    #define  ENABLE_STEPPER_X2() X2_ENABLE_WRITE( X_ENABLE_ON)
618
+  #else
619
+    #define  ENABLE_STEPPER_X2() NOOP
620
+  #endif
621
+#endif
622
+#ifndef DISABLE_STEPPER_X2
623
+  #if HAS_X2_ENABLE
624
+    #define DISABLE_STEPPER_X2() X2_ENABLE_WRITE(!X_ENABLE_ON)
625
+  #else
626
+    #define DISABLE_STEPPER_X2() NOOP
627
+  #endif
648 628
 #endif
649 629
 
650
-#define  enable_Y() do{ Y_enable(); Y2_enable(); }while(0)
651
-#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0)
652
-
653
-#if AXIS_DRIVER_TYPE_Z(L6470)
654
-  extern L6470 stepperZ;
655
-  #define Z_enable()  NOOP
656
-  #define Z_disable() stepperZ.free()
657
-#elif HAS_Z_ENABLE
658
-  #define Z_enable()  Z_ENABLE_WRITE( Z_ENABLE_ON)
659
-  #define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON)
660
-#else
661
-  #define Z_enable()  NOOP
662
-  #define Z_disable() NOOP
630
+#ifndef ENABLE_STEPPER_Y
631
+  #if HAS_Y_ENABLE
632
+    #define  ENABLE_STEPPER_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
633
+  #else
634
+    #define  ENABLE_STEPPER_Y() NOOP
635
+  #endif
636
+#endif
637
+#ifndef DISABLE_STEPPER_Y
638
+  #if HAS_Y_ENABLE
639
+    #define DISABLE_STEPPER_Y() Y_ENABLE_WRITE(!Y_ENABLE_ON)
640
+  #else
641
+    #define DISABLE_STEPPER_Y() NOOP
642
+  #endif
663 643
 #endif
664 644
 
665
-#if AXIS_DRIVER_TYPE_Z2(L6470)
666
-  extern L6470 stepperZ2;
667
-  #define Z2_enable()  NOOP
668
-  #define Z2_disable() stepperZ2.free()
669
-#elif HAS_Z2_ENABLE
670
-  #define Z2_enable()  Z2_ENABLE_WRITE( Z_ENABLE_ON)
671
-  #define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
672
-#else
673
-  #define Z2_enable()  NOOP
674
-  #define Z2_disable() NOOP
645
+#ifndef ENABLE_STEPPER_Y2
646
+  #if HAS_Y2_ENABLE
647
+    #define  ENABLE_STEPPER_Y2() Y2_ENABLE_WRITE( Y_ENABLE_ON)
648
+  #else
649
+    #define  ENABLE_STEPPER_Y2() NOOP
650
+  #endif
651
+#endif
652
+#ifndef DISABLE_STEPPER_Y2
653
+  #if HAS_Y2_ENABLE
654
+    #define DISABLE_STEPPER_Y2() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
655
+  #else
656
+    #define DISABLE_STEPPER_Y2() NOOP
657
+  #endif
675 658
 #endif
676 659
 
677
-#if AXIS_DRIVER_TYPE_Z3(L6470)
678
-  extern L6470 stepperZ3;
679
-  #define Z3_enable()  NOOP
680
-  #define Z3_disable() stepperZ3.free()
681
-#elif HAS_Z3_ENABLE
682
-  #define Z3_enable()  Z3_ENABLE_WRITE( Z_ENABLE_ON)
683
-  #define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
684
-#else
685
-  #define Z3_enable()  NOOP
686
-  #define Z3_disable() NOOP
660
+#ifndef ENABLE_STEPPER_Z
661
+  #if HAS_Z_ENABLE
662
+    #define  ENABLE_STEPPER_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
663
+  #else
664
+    #define  ENABLE_STEPPER_Z() NOOP
665
+  #endif
666
+#endif
667
+#ifndef DISABLE_STEPPER_Z
668
+  #if HAS_Z_ENABLE
669
+    #define DISABLE_STEPPER_Z() Z_ENABLE_WRITE(!Z_ENABLE_ON)
670
+  #else
671
+    #define DISABLE_STEPPER_Z() NOOP
672
+  #endif
687 673
 #endif
688 674
 
689
-#if AXIS_DRIVER_TYPE_Z4(L6470)
690
-  extern L6470 stepperZ4;
691
-  #define Z4_enable()  NOOP
692
-  #define Z4_disable() stepperZ4.free()
693
-#elif HAS_Z4_ENABLE
694
-  #define Z4_enable()  Z4_ENABLE_WRITE( Z_ENABLE_ON)
695
-  #define Z4_disable() Z4_ENABLE_WRITE(!Z_ENABLE_ON)
696
-#else
697
-  #define Z4_enable()  NOOP
698
-  #define Z4_disable() NOOP
675
+#ifndef ENABLE_STEPPER_Z2
676
+  #if HAS_Z2_ENABLE
677
+    #define  ENABLE_STEPPER_Z2() Z2_ENABLE_WRITE( Z_ENABLE_ON)
678
+  #else
679
+    #define  ENABLE_STEPPER_Z2() NOOP
680
+  #endif
681
+#endif
682
+#ifndef DISABLE_STEPPER_Z2
683
+  #if HAS_Z2_ENABLE
684
+    #define DISABLE_STEPPER_Z2() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
685
+  #else
686
+    #define DISABLE_STEPPER_Z2() NOOP
687
+  #endif
699 688
 #endif
700 689
 
701
-#define  enable_Z() do{ Z_enable();  Z2_enable();  Z3_enable();  Z4_enable(); }while(0)
702
-#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); Z4_disable(); CBI(axis_known_position, Z_AXIS); }while(0)
690
+#ifndef ENABLE_STEPPER_Z3
691
+  #if HAS_Z3_ENABLE
692
+    #define  ENABLE_STEPPER_Z3() Z3_ENABLE_WRITE( Z_ENABLE_ON)
693
+  #else
694
+    #define  ENABLE_STEPPER_Z3() NOOP
695
+  #endif
696
+#endif
697
+#ifndef DISABLE_STEPPER_Z3
698
+  #if HAS_Z3_ENABLE
699
+    #define DISABLE_STEPPER_Z3() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
700
+  #else
701
+    #define DISABLE_STEPPER_Z3() NOOP
702
+  #endif
703
+#endif
703 704
 
704
-//
705
-// Extruder Stepper enable / disable
706
-//
705
+#ifndef ENABLE_STEPPER_Z4
706
+  #if HAS_Z4_ENABLE
707
+    #define  ENABLE_STEPPER_Z4() Z4_ENABLE_WRITE( Z_ENABLE_ON)
708
+  #else
709
+    #define  ENABLE_STEPPER_Z4() NOOP
710
+  #endif
711
+#endif
712
+#ifndef DISABLE_STEPPER_Z4
713
+  #if HAS_Z4_ENABLE
714
+    #define DISABLE_STEPPER_Z4() Z4_ENABLE_WRITE(!Z_ENABLE_ON)
715
+  #else
716
+    #define DISABLE_STEPPER_Z4() NOOP
717
+  #endif
718
+#endif
707 719
 
708
-// define the individual enables/disables
709
-#if AXIS_DRIVER_TYPE_E0(L6470)
710
-  extern L6470 stepperE0;
711
-  #define  E0_enable() NOOP
712
-  #define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
713
-#elif HAS_E0_ENABLE
714
-  #define  E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON)
715
-  #define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON)
716
-#else
717
-  #define  E0_enable() NOOP
718
-  #define E0_disable() NOOP
720
+#ifndef ENABLE_STEPPER_E0
721
+  #if HAS_E0_ENABLE
722
+    #define  ENABLE_STEPPER_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
723
+  #else
724
+    #define  ENABLE_STEPPER_E0() NOOP
725
+  #endif
726
+#endif
727
+#ifndef DISABLE_STEPPER_E0
728
+  #if HAS_E0_ENABLE
729
+    #define DISABLE_STEPPER_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
730
+  #else
731
+    #define DISABLE_STEPPER_E0() NOOP
732
+  #endif
719 733
 #endif
720 734
 
721
-#if AXIS_DRIVER_TYPE_E1(L6470)
722
-  extern L6470 stepperE1;
723
-  #define  E1_enable() NOOP
724
-  #define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
725
-#elif E_STEPPERS > 1 && HAS_E1_ENABLE
726
-  #define  E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON)
727
-  #define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON)
728
-#else
729
-  #define  E1_enable() NOOP
730
-  #define E1_disable() NOOP
735
+#ifndef ENABLE_STEPPER_E1
736
+  #if E_STEPPERS > 1 && HAS_E1_ENABLE
737
+    #define  ENABLE_STEPPER_E1() E1_ENABLE_WRITE( E_ENABLE_ON)
738
+  #else
739
+    #define  ENABLE_STEPPER_E1() NOOP
740
+  #endif
741
+#endif
742
+#ifndef DISABLE_STEPPER_E1
743
+  #if E_STEPPERS > 1 && HAS_E1_ENABLE
744
+    #define DISABLE_STEPPER_E1() E1_ENABLE_WRITE(!E_ENABLE_ON)
745
+  #else
746
+    #define DISABLE_STEPPER_E1() NOOP
747
+  #endif
731 748
 #endif
732 749
 
733
-#if AXIS_DRIVER_TYPE_E2(L6470)
734
-  extern L6470 stepperE2;
735
-  #define  E2_enable() NOOP
736
-  #define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
737
-#elif E_STEPPERS > 2 && HAS_E2_ENABLE
738
-  #define  E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON)
739
-  #define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON)
740
-#else
741
-  #define  E2_enable() NOOP
742
-  #define E2_disable() NOOP
750
+#ifndef ENABLE_STEPPER_E2
751
+  #if E_STEPPERS > 2 && HAS_E2_ENABLE
752
+    #define  ENABLE_STEPPER_E2() E2_ENABLE_WRITE( E_ENABLE_ON)
753
+  #else
754
+    #define  ENABLE_STEPPER_E2() NOOP
755
+  #endif
756
+#endif
757
+#ifndef DISABLE_STEPPER_E2
758
+  #if E_STEPPERS > 2 && HAS_E2_ENABLE
759
+    #define DISABLE_STEPPER_E2() E2_ENABLE_WRITE(!E_ENABLE_ON)
760
+  #else
761
+    #define DISABLE_STEPPER_E2() NOOP
762
+  #endif
743 763
 #endif
744 764
 
745
-#if AXIS_DRIVER_TYPE_E3(L6470)
746
-  extern L6470 stepperE3;
747
-  #define  E3_enable() NOOP
748
-  #define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0)
749
-#elif E_STEPPERS > 3 && HAS_E3_ENABLE
750
-  #define  E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON)
751
-  #define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON)
752
-#else
753
-  #define  E3_enable() NOOP
754
-  #define E3_disable() NOOP
765
+#ifndef ENABLE_STEPPER_E3
766
+  #if E_STEPPERS > 3 && HAS_E3_ENABLE
767
+    #define  ENABLE_STEPPER_E3() E3_ENABLE_WRITE( E_ENABLE_ON)
768
+  #else
769
+    #define  ENABLE_STEPPER_E3() NOOP
770
+  #endif
771
+#endif
772
+#ifndef DISABLE_STEPPER_E3
773
+  #if E_STEPPERS > 3 && HAS_E3_ENABLE
774
+    #define DISABLE_STEPPER_E3() E3_ENABLE_WRITE(!E_ENABLE_ON)
775
+  #else
776
+    #define DISABLE_STEPPER_E3() NOOP
777
+  #endif
755 778
 #endif
756 779
 
757
-#if AXIS_DRIVER_TYPE_E4(L6470)
758
-  extern L6470 stepperE4;
759
-  #define  E4_enable() NOOP
760
-  #define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
761
-#elif E_STEPPERS > 4 && HAS_E4_ENABLE
762
-  #define  E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON)
763
-  #define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON)
764
-#else
765
-  #define  E4_enable() NOOP
766
-  #define E4_disable() NOOP
780
+#ifndef ENABLE_STEPPER_E4
781
+  #if E_STEPPERS > 4 && HAS_E4_ENABLE
782
+    #define  ENABLE_STEPPER_E4() E4_ENABLE_WRITE( E_ENABLE_ON)
783
+  #else
784
+    #define  ENABLE_STEPPER_E4() NOOP
785
+  #endif
786
+#endif
787
+#ifndef DISABLE_STEPPER_E4
788
+  #if E_STEPPERS > 4 && HAS_E4_ENABLE
789
+    #define DISABLE_STEPPER_E4() E4_ENABLE_WRITE(!E_ENABLE_ON)
790
+  #else
791
+    #define DISABLE_STEPPER_E4() NOOP
792
+  #endif
767 793
 #endif
768 794
 
769
-#if AXIS_DRIVER_TYPE_E5(L6470)
770
-  extern L6470 stepperE5;
771
-  #define  E5_enable() NOOP
772
-  #define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
773
-#elif E_STEPPERS > 5 && HAS_E5_ENABLE
774
-  #define  E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON)
775
-  #define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON)
776
-#else
777
-  #define  E5_enable() NOOP
778
-  #define E5_disable() NOOP
795
+#ifndef ENABLE_STEPPER_E5
796
+  #if E_STEPPERS > 5 && HAS_E5_ENABLE
797
+    #define  ENABLE_STEPPER_E5() E5_ENABLE_WRITE( E_ENABLE_ON)
798
+  #else
799
+    #define  ENABLE_STEPPER_E5() NOOP
800
+  #endif
801
+#endif
802
+#ifndef DISABLE_STEPPER_E5
803
+  #if E_STEPPERS > 5 && HAS_E5_ENABLE
804
+    #define DISABLE_STEPPER_E5() E5_ENABLE_WRITE(!E_ENABLE_ON)
805
+  #else
806
+    #define DISABLE_STEPPER_E5() NOOP
807
+  #endif
779 808
 #endif
780 809
 
781
-#if AXIS_DRIVER_TYPE_E6(L6470)
782
-  extern L6470 stepperE6;
783
-  #define  E6_enable() NOOP
784
-  #define E6_disable() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0)
785
-#elif E_STEPPERS > 6 && HAS_E6_ENABLE
786
-  #define  E6_enable() E6_ENABLE_WRITE( E_ENABLE_ON)
787
-  #define E6_disable() E6_ENABLE_WRITE(!E_ENABLE_ON)
788
-#else
789
-  #define  E6_enable() NOOP
790
-  #define E6_disable() NOOP
810
+#ifndef ENABLE_STEPPER_E6
811
+  #if E_STEPPERS > 6 && HAS_E6_ENABLE
812
+    #define  ENABLE_STEPPER_E6() E6_ENABLE_WRITE( E_ENABLE_ON)
813
+  #else
814
+    #define  ENABLE_STEPPER_E6() NOOP
815
+  #endif
816
+#endif
817
+#ifndef DISABLE_STEPPER_E6
818
+  #if E_STEPPERS > 6 && HAS_E6_ENABLE
819
+    #define DISABLE_STEPPER_E6() E6_ENABLE_WRITE(!E_ENABLE_ON)
820
+  #else
821
+    #define DISABLE_STEPPER_E6() NOOP
822
+  #endif
791 823
 #endif
792 824
 
793
-#if AXIS_DRIVER_TYPE_E7(L6470)
794
-  extern L6470 stepperE7;
795
-  #define  E7_enable() NOOP
796
-  #define E7_disable() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0)
797
-#elif E_STEPPERS > 7 && HAS_E7_ENABLE
798
-  #define  E7_enable() E7_ENABLE_WRITE( E_ENABLE_ON)
799
-  #define E7_disable() E7_ENABLE_WRITE(!E_ENABLE_ON)
800
-#else
801
-  #define  E7_enable() NOOP
802
-  #define E7_disable() NOOP
825
+#ifndef ENABLE_STEPPER_E7
826
+  #if E_STEPPERS > 7 && HAS_E7_ENABLE
827
+    #define  ENABLE_STEPPER_E7() E7_ENABLE_WRITE( E_ENABLE_ON)
828
+  #else
829
+    #define  ENABLE_STEPPER_E7() NOOP
830
+  #endif
803 831
 #endif
832
+#ifndef DISABLE_STEPPER_E7
833
+  #if E_STEPPERS > 7 && HAS_E7_ENABLE
834
+    #define DISABLE_STEPPER_E7() E7_ENABLE_WRITE(!E_ENABLE_ON)
835
+  #else
836
+    #define DISABLE_STEPPER_E7() NOOP
837
+  #endif
838
+#endif
839
+
840
+//
841
+// Axis steppers enable / disable macros
842
+//
843
+
844
+#define  ENABLE_AXIS_X() do{ ENABLE_STEPPER_X(); ENABLE_STEPPER_X2(); }while(0)
845
+#define DISABLE_AXIS_X() do{ DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); CBI(axis_known_position, X_AXIS); }while(0)
846
+
847
+#define  ENABLE_AXIS_Y() do{ ENABLE_STEPPER_Y(); ENABLE_STEPPER_Y2(); }while(0)
848
+#define DISABLE_AXIS_Y() do{ DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); CBI(axis_known_position, Y_AXIS); }while(0)
849
+
850
+#define  ENABLE_AXIS_Z() do{ ENABLE_STEPPER_Z();  ENABLE_STEPPER_Z2();  ENABLE_STEPPER_Z3();  ENABLE_STEPPER_Z4(); }while(0)
851
+#define DISABLE_AXIS_Z() do{ DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); CBI(axis_known_position, Z_AXIS); }while(0)
852
+
853
+//
854
+// Extruder steppers enable / disable macros
855
+//
804 856
 
805 857
 #if ENABLED(MIXING_EXTRUDER)
806 858
 
807 859
   /**
808
-   * Mixing steppers synchronize their enable (and direction) together
860
+   * Mixing steppers keep all their enable (and direction) states synchronized
809 861
    */
810 862
   #if MIXING_STEPPERS > 7
811
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable();  E5_enable();  E6_enable();  E7_enable(); }
812
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); E7_disable(); }
863
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4();  ENABLE_STEPPER_E5();  ENABLE_STEPPER_E6();  ENABLE_STEPPER_E7(); }
864
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); DISABLE_STEPPER_E6(); DISABLE_STEPPER_E7(); }
813 865
   #elif MIXING_STEPPERS > 6
814
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable();  E5_enable();  E6_enable(); }
815
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); }
866
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4();  ENABLE_STEPPER_E5();  ENABLE_STEPPER_E6(); }
867
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); DISABLE_STEPPER_E6(); }
816 868
   #elif MIXING_STEPPERS > 5
817
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable();  E5_enable(); }
818
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); }
869
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4();  ENABLE_STEPPER_E5(); }
870
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); }
819 871
   #elif MIXING_STEPPERS > 4
820
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable(); }
821
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); }
872
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4(); }
873
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); }
822 874
   #elif MIXING_STEPPERS > 3
823
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable(); }
824
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); }
875
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3(); }
876
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); }
825 877
   #elif MIXING_STEPPERS > 2
826
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable(); }
827
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); }
828
-  #else
829
-    #define  enable_E0() { E0_enable();  E1_enable(); }
830
-    #define disable_E0() { E0_disable(); E1_disable(); }
831
-  #endif
832
-  #define  enable_E1() NOOP
833
-  #define disable_E1() NOOP
834
-  #define  enable_E2() NOOP
835
-  #define disable_E2() NOOP
836
-  #define  enable_E3() NOOP
837
-  #define disable_E3() NOOP
838
-  #define  enable_E4() NOOP
839
-  #define disable_E4() NOOP
840
-  #define  enable_E5() NOOP
841
-  #define disable_E5() NOOP
842
-  #define  enable_E6() NOOP
843
-  #define disable_E6() NOOP
844
-  #define  enable_E7() NOOP
845
-  #define disable_E7() NOOP
846
-
847
-#else // !MIXING_EXTRUDER
878
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2(); }
879
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); }
880
+  #else
881
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1(); }
882
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); }
883
+  #endif
848 884
 
849
-  #if HAS_E0_ENABLE
850
-    #define  enable_E0() E0_enable()
851
-    #define disable_E0() E0_disable()
885
+#endif // !MIXING_EXTRUDER
886
+
887
+#ifndef ENABLE_AXIS_E0
888
+  #if E_STEPPERS > 0 && HAS_E0_ENABLE
889
+    #define  ENABLE_AXIS_E0() ENABLE_STEPPER_E0()
852 890
   #else
853
-    #define  enable_E0() NOOP
854
-    #define disable_E0() NOOP
891
+    #define  ENABLE_AXIS_E0() NOOP
855 892
   #endif
893
+#endif
894
+#ifndef DISABLE_AXIS_E0
895
+  #if E_STEPPERS > 0 && HAS_E0_DISABLE
896
+    #define DISABLE_AXIS_E0() DISABLE_STEPPER_E0()
897
+  #else
898
+    #define DISABLE_AXIS_E0() NOOP
899
+  #endif
900
+#endif
856 901
 
902
+#ifndef ENABLE_AXIS_E1
857 903
   #if E_STEPPERS > 1 && HAS_E1_ENABLE
858
-    #define  enable_E1() E1_enable()
859
-    #define disable_E1() E1_disable()
904
+    #define  ENABLE_AXIS_E1() ENABLE_STEPPER_E1()
860 905
   #else
861
-    #define  enable_E1() NOOP
862
-    #define disable_E1() NOOP
906
+    #define  ENABLE_AXIS_E1() NOOP
863 907
   #endif
908
+#endif
909
+#ifndef DISABLE_AXIS_E1
910
+  #if E_STEPPERS > 1 && HAS_E1_DISABLE
911
+    #define DISABLE_AXIS_E1() DISABLE_STEPPER_E1()
912
+  #else
913
+    #define DISABLE_AXIS_E1() NOOP
914
+  #endif
915
+#endif
864 916
 
917
+#ifndef ENABLE_AXIS_E2
865 918
   #if E_STEPPERS > 2 && HAS_E2_ENABLE
866
-    #define  enable_E2() E2_enable()
867
-    #define disable_E2() E2_disable()
919
+    #define  ENABLE_AXIS_E2() ENABLE_STEPPER_E2()
920
+  #else
921
+    #define  ENABLE_AXIS_E2() NOOP
922
+  #endif
923
+#endif
924
+#ifndef DISABLE_AXIS_E2
925
+  #if E_STEPPERS > 2 && HAS_E2_DISABLE
926
+    #define DISABLE_AXIS_E2() DISABLE_STEPPER_E2()
868 927
   #else
869
-    #define  enable_E2() NOOP
870
-    #define disable_E2() NOOP
928
+    #define DISABLE_AXIS_E2() NOOP
871 929
   #endif
930
+#endif
872 931
 
932
+#ifndef ENABLE_AXIS_E3
873 933
   #if E_STEPPERS > 3 && HAS_E3_ENABLE
874
-    #define  enable_E3() E3_enable()
875
-    #define disable_E3() E3_disable()
934
+    #define  ENABLE_AXIS_E3() ENABLE_STEPPER_E3()
876 935
   #else
877
-    #define  enable_E3() NOOP
878
-    #define disable_E3() NOOP
936
+    #define  ENABLE_AXIS_E3() NOOP
879 937
   #endif
938
+#endif
939
+#ifndef DISABLE_AXIS_E3
940
+  #if E_STEPPERS > 3 && HAS_E3_DISABLE
941
+    #define DISABLE_AXIS_E3() DISABLE_STEPPER_E3()
942
+  #else
943
+    #define DISABLE_AXIS_E3() NOOP
944
+  #endif
945
+#endif
880 946
 
947
+#ifndef ENABLE_AXIS_E4
881 948
   #if E_STEPPERS > 4 && HAS_E4_ENABLE
882
-    #define  enable_E4() E4_enable()
883
-    #define disable_E4() E4_disable()
949
+    #define  ENABLE_AXIS_E4() ENABLE_STEPPER_E4()
950
+  #else
951
+    #define  ENABLE_AXIS_E4() NOOP
952
+  #endif
953
+#endif
954
+#ifndef DISABLE_AXIS_E4
955
+  #if E_STEPPERS > 4 && HAS_E4_DISABLE
956
+    #define DISABLE_AXIS_E4() DISABLE_STEPPER_E4()
884 957
   #else
885
-    #define  enable_E4() NOOP
886
-    #define disable_E4() NOOP
958
+    #define DISABLE_AXIS_E4() NOOP
887 959
   #endif
960
+#endif
888 961
 
962
+#ifndef ENABLE_AXIS_E5
889 963
   #if E_STEPPERS > 5 && HAS_E5_ENABLE
890
-    #define  enable_E5() E5_enable()
891
-    #define disable_E5() E5_disable()
964
+    #define  ENABLE_AXIS_E5() ENABLE_STEPPER_E5()
892 965
   #else
893
-    #define  enable_E5() NOOP
894
-    #define disable_E5() NOOP
966
+    #define  ENABLE_AXIS_E5() NOOP
895 967
   #endif
968
+#endif
969
+#ifndef DISABLE_AXIS_E5
970
+  #if E_STEPPERS > 5 && HAS_E5_DISABLE
971
+    #define DISABLE_AXIS_E5() DISABLE_STEPPER_E5()
972
+  #else
973
+    #define DISABLE_AXIS_E5() NOOP
974
+  #endif
975
+#endif
896 976
 
977
+#ifndef ENABLE_AXIS_E6
897 978
   #if E_STEPPERS > 6 && HAS_E6_ENABLE
898
-    #define  enable_E6() E6_enable()
899
-    #define disable_E6() E6_disable()
979
+    #define  ENABLE_AXIS_E6() ENABLE_STEPPER_E6()
900 980
   #else
901
-    #define  enable_E6() NOOP
902
-    #define disable_E6() NOOP
981
+    #define  ENABLE_AXIS_E6() NOOP
903 982
   #endif
983
+#endif
984
+#ifndef DISABLE_AXIS_E6
985
+  #if E_STEPPERS > 6 && HAS_E6_DISABLE
986
+    #define DISABLE_AXIS_E6() DISABLE_STEPPER_E6()
987
+  #else
988
+    #define DISABLE_AXIS_E6() NOOP
989
+  #endif
990
+#endif
904 991
 
992
+#ifndef ENABLE_AXIS_E7
905 993
   #if E_STEPPERS > 7 && HAS_E7_ENABLE
906
-    #define  enable_E7() E7_enable()
907
-    #define disable_E7() E7_disable()
994
+    #define  ENABLE_AXIS_E7() ENABLE_STEPPER_E7()
908 995
   #else
909
-    #define  enable_E7() NOOP
910
-    #define disable_E7() NOOP
996
+    #define  ENABLE_AXIS_E7() NOOP
911 997
   #endif
912
-
913
-#endif // !MIXING_EXTRUDER
998
+#endif
999
+#ifndef DISABLE_AXIS_E7
1000
+  #if E_STEPPERS > 7 && HAS_E7_DISABLE
1001
+    #define DISABLE_AXIS_E7() DISABLE_STEPPER_E7()
1002
+  #else
1003
+    #define DISABLE_AXIS_E7() NOOP
1004
+  #endif
1005
+#endif

Notiek ielāde…
Atcelt
Saglabāt