Browse Source

Merge pull request #12063 from thinkyhead/bf2_sensitive_pins

Add MS3 pins. Optimize SENSITIVE_PINS.
Scott Lahteine 6 years ago
parent
commit
49d4ed4d3f
No account linked to committer's email address

+ 3
- 0
Marlin/src/Marlin.cpp View File

@@ -259,6 +259,9 @@ void setup_powerhold() {
259 259
 /**
260 260
  * Sensitive pin test for M42, M226
261 261
  */
262
+
263
+#include "pins/sensitive_pins.h"
264
+
262 265
 bool pin_is_protected(const pin_t pin) {
263 266
   static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS;
264 267
   for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) {

+ 9
- 5
Marlin/src/gcode/control/M350_M351.cpp View File

@@ -41,17 +41,21 @@ void GcodeSuite::M350() {
41 41
 
42 42
 /**
43 43
  * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B
44
- *       S# determines MS1 or MS2, X# sets the pin high/low.
44
+ *       S# determines MS1, MS2 or MS3, X# sets the pin high/low.
45 45
  */
46 46
 void GcodeSuite::M351() {
47 47
   if (parser.seenval('S')) switch (parser.value_byte()) {
48 48
     case 1:
49
-      LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1);
50
-      if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1);
49
+      LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
50
+      if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1, -1);
51 51
       break;
52 52
     case 2:
53
-      LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte());
54
-      if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte());
53
+      LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
54
+      if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte(), -1);
55
+      break;
56
+    case 3:
57
+      LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, -1, parser.value_byte());
58
+      if (parser.seenval('B')) stepper.microstep_ms(4, -1, -1, parser.value_byte());
55 59
       break;
56 60
   }
57 61
   stepper.microstep_readings();

+ 29
- 17
Marlin/src/inc/Conditionals_post.h View File

@@ -236,26 +236,37 @@
236 236
   #define MAX_AUTORETRACT 99
237 237
 #endif
238 238
 
239
-// MS1 MS2 Stepper Driver Microstepping mode table
240
-#define MICROSTEP1 LOW,LOW
241
-#if ENABLED(HEROIC_STEPPER_DRIVERS)
242
-  #define MICROSTEP128 LOW,HIGH
243
-#else
244
-  #define MICROSTEP2 HIGH,LOW
245
-  #define MICROSTEP4 LOW,HIGH
246
-#endif
247
-#define MICROSTEP8 HIGH,HIGH
248
-#ifdef __SAM3X8E__
249
-  #if MB(ALLIGATOR)
250
-    #define MICROSTEP16 LOW,LOW
251
-    #define MICROSTEP32 HIGH,HIGH
239
+// MS1 MS2 MS3 Stepper Driver Microstepping mode table
240
+#if DISABLED(MICROSTEP_CUSTOM)
241
+  #define MICROSTEP1 LOW,LOW,LOW
242
+  #if ENABLED(HEROIC_STEPPER_DRIVERS)
243
+    #define MICROSTEP128 LOW,HIGH,LOW
244
+  #else
245
+    #define MICROSTEP2 HIGH,LOW,LOW
246
+    #define MICROSTEP4 LOW,HIGH,LOW
247
+  #endif
248
+  #define MICROSTEP8 HIGH,HIGH,LOW
249
+  #ifdef __SAM3X8E__
250
+    #if MB(ALLIGATOR)
251
+      #define MICROSTEP16 LOW,LOW,LOW
252
+      #define MICROSTEP32 HIGH,HIGH,LOW
253
+    #else
254
+      #define MICROSTEP16 HIGH,HIGH,LOW
255
+    #endif
252 256
   #else
253
-    #define MICROSTEP16 HIGH,HIGH
257
+    #define MICROSTEP16 HIGH,HIGH,LOW
254 258
   #endif
255
-#else
256
-  #define MICROSTEP16 HIGH,HIGH
257 259
 #endif
258 260
 
261
+#define HAS_MICROSTEP1 defined(MICROSTEP1)
262
+#define HAS_MICROSTEP2 defined(MICROSTEP2)
263
+#define HAS_MICROSTEP4 defined(MICROSTEP4)
264
+#define HAS_MICROSTEP8 defined(MICROSTEP8)
265
+#define HAS_MICROSTEP16 defined(MICROSTEP16)
266
+#define HAS_MICROSTEP32 defined(MICROSTEP32)
267
+#define HAS_MICROSTEP64 defined(MICROSTEP64)
268
+#define HAS_MICROSTEP128 defined(MICROSTEP128)
269
+
259 270
 /**
260 271
  * Override here because this is set in Configuration_adv.h
261 272
  */
@@ -828,6 +839,7 @@
828 839
 #define HAS_Z3_ENABLE     (PIN_EXISTS(Z3_ENABLE))
829 840
 #define HAS_Z3_DIR        (PIN_EXISTS(Z3_DIR))
830 841
 #define HAS_Z3_STEP       (PIN_EXISTS(Z3_STEP))
842
+#define HAS_Z3_MICROSTEPS (PIN_EXISTS(Z3_MS1))
831 843
 
832 844
 // Extruder steppers and solenoids
833 845
 #define HAS_E0_ENABLE     (PIN_EXISTS(E0_ENABLE))
@@ -1003,7 +1015,7 @@
1003 1015
 #define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE))
1004 1016
 
1005 1017
 // Digital control
1006
-#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS)
1018
+#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS)
1007 1019
 #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
1008 1020
 #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
1009 1021
 #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))

+ 2
- 0
Marlin/src/inc/MarlinConfig.h View File

@@ -31,6 +31,8 @@
31 31
 
32 32
 #include "../pins/pins.h"
33 33
 
34
+#include HAL_PATH(../HAL, spi_pins.h)
35
+
34 36
 #if defined(__AVR__) && !defined(USBCON)
35 37
   #define HardwareSerial_h // trick to disable the standard HWserial
36 38
 #endif

+ 234
- 30
Marlin/src/module/stepper.cpp View File

@@ -2504,53 +2504,136 @@ void Stepper::report_positions() {
2504 2504
    */
2505 2505
 
2506 2506
   void Stepper::microstep_init() {
2507
-    SET_OUTPUT(X_MS1_PIN);
2508
-    SET_OUTPUT(X_MS2_PIN);
2507
+    #if HAS_X_MICROSTEPS
2508
+      SET_OUTPUT(X_MS1_PIN);
2509
+      SET_OUTPUT(X_MS2_PIN);
2510
+      #if PIN_EXISTS(X_MS3)
2511
+        SET_OUTPUT(X_MS3_PIN);
2512
+      #endif
2513
+    #endif
2514
+    #if HAS_X2_MICROSTEPS
2515
+      SET_OUTPUT(X2_MS1_PIN);
2516
+      SET_OUTPUT(X2_MS2_PIN);
2517
+      #if PIN_EXISTS(X2_MS3)
2518
+        SET_OUTPUT(X2_MS3_PIN);
2519
+      #endif
2520
+    #endif
2509 2521
     #if HAS_Y_MICROSTEPS
2510 2522
       SET_OUTPUT(Y_MS1_PIN);
2511 2523
       SET_OUTPUT(Y_MS2_PIN);
2524
+      #if PIN_EXISTS(Y_MS3)
2525
+        SET_OUTPUT(Y_MS3_PIN);
2526
+      #endif
2527
+    #endif
2528
+    #if HAS_Y2_MICROSTEPS
2529
+      SET_OUTPUT(Y2_MS1_PIN);
2530
+      SET_OUTPUT(Y2_MS2_PIN);
2531
+      #if PIN_EXISTS(Y2_MS3)
2532
+        SET_OUTPUT(Y2_MS3_PIN);
2533
+      #endif
2512 2534
     #endif
2513 2535
     #if HAS_Z_MICROSTEPS
2514 2536
       SET_OUTPUT(Z_MS1_PIN);
2515 2537
       SET_OUTPUT(Z_MS2_PIN);
2538
+      #if PIN_EXISTS(Z_MS3)
2539
+        SET_OUTPUT(Z_MS3_PIN);
2540
+      #endif
2541
+    #endif
2542
+    #if HAS_Z2_MICROSTEPS
2543
+      SET_OUTPUT(Z2_MS1_PIN);
2544
+      SET_OUTPUT(Z2_MS2_PIN);
2545
+      #if PIN_EXISTS(Z2_MS3)
2546
+        SET_OUTPUT(Z2_MS3_PIN);
2547
+      #endif
2516 2548
     #endif
2549
+    #if HAS_Z3_MICROSTEPS
2550
+      SET_OUTPUT(Z3_MS1_PIN);
2551
+      SET_OUTPUT(Z3_MS2_PIN);
2552
+      #if PIN_EXISTS(Z3_MS3)
2553
+        SET_OUTPUT(Z3_MS3_PIN);
2554
+      #endif
2555
+    #endif    
2517 2556
     #if HAS_E0_MICROSTEPS
2518 2557
       SET_OUTPUT(E0_MS1_PIN);
2519 2558
       SET_OUTPUT(E0_MS2_PIN);
2559
+      #if PIN_EXISTS(E0_MS3)
2560
+        SET_OUTPUT(E0_MS3_PIN);
2561
+      #endif
2520 2562
     #endif
2521 2563
     #if HAS_E1_MICROSTEPS
2522 2564
       SET_OUTPUT(E1_MS1_PIN);
2523 2565
       SET_OUTPUT(E1_MS2_PIN);
2566
+      #if PIN_EXISTS(E1_MS3)
2567
+        SET_OUTPUT(E1_MS3_PIN);
2568
+      #endif
2524 2569
     #endif
2525 2570
     #if HAS_E2_MICROSTEPS
2526 2571
       SET_OUTPUT(E2_MS1_PIN);
2527 2572
       SET_OUTPUT(E2_MS2_PIN);
2573
+      #if PIN_EXISTS(E2_MS3)
2574
+        SET_OUTPUT(E2_MS3_PIN);
2575
+      #endif
2528 2576
     #endif
2529 2577
     #if HAS_E3_MICROSTEPS
2530 2578
       SET_OUTPUT(E3_MS1_PIN);
2531 2579
       SET_OUTPUT(E3_MS2_PIN);
2580
+      #if PIN_EXISTS(E3_MS3)
2581
+        SET_OUTPUT(E3_MS3_PIN);
2582
+      #endif
2532 2583
     #endif
2533 2584
     #if HAS_E4_MICROSTEPS
2534 2585
       SET_OUTPUT(E4_MS1_PIN);
2535 2586
       SET_OUTPUT(E4_MS2_PIN);
2587
+      #if PIN_EXISTS(E4_MS3)
2588
+        SET_OUTPUT(E4_MS3_PIN);
2589
+      #endif
2536 2590
     #endif
2537 2591
     #if HAS_E5_MICROSTEPS
2538 2592
       SET_OUTPUT(E5_MS1_PIN);
2539 2593
       SET_OUTPUT(E5_MS2_PIN);
2594
+      #if PIN_EXISTS(E5_MS3)
2595
+        SET_OUTPUT(E5_MS3_PIN);
2596
+      #endif
2540 2597
     #endif
2541 2598
     static const uint8_t microstep_modes[] = MICROSTEP_MODES;
2542 2599
     for (uint16_t i = 0; i < COUNT(microstep_modes); i++)
2543 2600
       microstep_mode(i, microstep_modes[i]);
2544 2601
   }
2545 2602
 
2546
-  void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2) {
2603
+  void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3) {
2547 2604
     if (ms1 >= 0) switch (driver) {
2548
-      case 0: WRITE(X_MS1_PIN, ms1); break;
2549
-      #if HAS_Y_MICROSTEPS
2550
-        case 1: WRITE(Y_MS1_PIN, ms1); break;
2605
+      #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS
2606
+        case 0:
2607
+          #if HAS_X_MICROSTEPS
2608
+            WRITE(X_MS1_PIN, ms1);
2609
+          #endif
2610
+          #if HAS_X2_MICROSTEPS
2611
+            WRITE(X2_MS1_PIN, ms1);
2612
+          #endif
2613
+          break;
2551 2614
       #endif
2552
-      #if HAS_Z_MICROSTEPS
2553
-        case 2: WRITE(Z_MS1_PIN, ms1); break;
2615
+      #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS
2616
+        case 1:
2617
+          #if HAS_Y_MICROSTEPS
2618
+            WRITE(Y_MS1_PIN, ms1);
2619
+          #endif
2620
+          #if HAS_Y2_MICROSTEPS
2621
+            WRITE(Y2_MS1_PIN, ms1);
2622
+          #endif
2623
+          break;
2624
+      #endif
2625
+      #if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS
2626
+        case 2:
2627
+          #if HAS_Z_MICROSTEPS
2628
+            WRITE(Z_MS1_PIN, ms1);
2629
+          #endif
2630
+          #if HAS_Z2_MICROSTEPS
2631
+            WRITE(Z2_MS1_PIN, ms1);
2632
+          #endif
2633
+          #if HAS_Z3_MICROSTEPS
2634
+            WRITE(Z3_MS1_PIN, ms1);
2635
+          #endif
2636
+          break;
2554 2637
       #endif
2555 2638
       #if HAS_E0_MICROSTEPS
2556 2639
         case 3: WRITE(E0_MS1_PIN, ms1); break;
@@ -2572,12 +2655,38 @@ void Stepper::report_positions() {
2572 2655
       #endif
2573 2656
     }
2574 2657
     if (ms2 >= 0) switch (driver) {
2575
-      case 0: WRITE(X_MS2_PIN, ms2); break;
2576
-      #if HAS_Y_MICROSTEPS
2577
-        case 1: WRITE(Y_MS2_PIN, ms2); break;
2658
+      #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS
2659
+        case 0:
2660
+          #if HAS_X_MICROSTEPS
2661
+            WRITE(X_MS2_PIN, ms2);
2662
+          #endif
2663
+          #if HAS_X2_MICROSTEPS
2664
+            WRITE(X2_MS2_PIN, ms2);
2665
+          #endif
2666
+          break;
2667
+      #endif
2668
+      #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS
2669
+        case 1:
2670
+          #if HAS_Y_MICROSTEPS
2671
+            WRITE(Y_MS2_PIN, ms2);
2672
+          #endif
2673
+          #if HAS_Y2_MICROSTEPS
2674
+            WRITE(Y2_MS2_PIN, ms2);
2675
+          #endif
2676
+          break;
2578 2677
       #endif
2579
-      #if HAS_Z_MICROSTEPS
2580
-        case 2: WRITE(Z_MS2_PIN, ms2); break;
2678
+      #if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS
2679
+        case 2:
2680
+          #if HAS_Z_MICROSTEPS
2681
+            WRITE(Z_MS2_PIN, ms2);
2682
+          #endif
2683
+          #if HAS_Z2_MICROSTEPS
2684
+            WRITE(Z2_MS2_PIN, ms2);
2685
+          #endif
2686
+          #if HAS_Z3_MICROSTEPS
2687
+            WRITE(Z3_MS2_PIN, ms2);
2688
+          #endif
2689
+          break;
2581 2690
       #endif
2582 2691
       #if HAS_E0_MICROSTEPS
2583 2692
         case 3: WRITE(E0_MS2_PIN, ms2); break;
@@ -2598,70 +2707,165 @@ void Stepper::report_positions() {
2598 2707
         case 8: WRITE(E5_MS2_PIN, ms2); break;
2599 2708
       #endif
2600 2709
     }
2710
+    if (ms3 >= 0) switch (driver) {
2711
+      #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS
2712
+        case 0:
2713
+          #if HAS_X_MICROSTEPS && PIN_EXISTS(X_MS3)
2714
+            WRITE(X_MS3_PIN, ms3);
2715
+          #endif
2716
+          #if HAS_X2_MICROSTEPS && PIN_EXISTS(X2_MS3)
2717
+            WRITE(X2_MS3_PIN, ms3);
2718
+          #endif
2719
+          break;
2720
+      #endif
2721
+      #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS
2722
+        case 1:
2723
+          #if HAS_Y_MICROSTEPS && PIN_EXISTS(Y_MS3)
2724
+            WRITE(Y_MS3_PIN, ms3);
2725
+          #endif
2726
+          #if HAS_Y2_MICROSTEPS && PIN_EXISTS(Y2_MS3)
2727
+            WRITE(Y2_MS3_PIN, ms3);
2728
+          #endif
2729
+          break;
2730
+      #endif
2731
+      #if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS
2732
+        case 2:
2733
+          #if HAS_Z_MICROSTEPS && PIN_EXISTS(Z_MS3)
2734
+            WRITE(Z_MS3_PIN, ms3);
2735
+          #endif
2736
+          #if HAS_Z2_MICROSTEPS && PIN_EXISTS(Z2_MS3)
2737
+            WRITE(Z2_MS3_PIN, ms3);
2738
+          #endif
2739
+          #if HAS_Z3_MICROSTEPS && PIN_EXISTS(Z3_MS3)
2740
+            WRITE(Z3_MS3_PIN, ms3);
2741
+          #endif
2742
+          break;
2743
+      #endif
2744
+      #if HAS_E0_MICROSTEPS && PIN_EXISTS(E0_MS3)
2745
+        case 3: WRITE(E0_MS3_PIN, ms3); break;
2746
+      #endif
2747
+      #if HAS_E1_MICROSTEPS && PIN_EXISTS(E1_MS3)
2748
+        case 4: WRITE(E1_MS3_PIN, ms3); break;
2749
+      #endif
2750
+      #if HAS_E2_MICROSTEPS && PIN_EXISTS(E2_MS3)
2751
+        case 5: WRITE(E2_MS3_PIN, ms3); break;
2752
+      #endif
2753
+      #if HAS_E3_MICROSTEPS && PIN_EXISTS(E3_MS3)
2754
+        case 6: WRITE(E3_MS3_PIN, ms3); break;
2755
+      #endif
2756
+      #if HAS_E4_MICROSTEPS && PIN_EXISTS(E4_MS3)
2757
+        case 7: WRITE(E4_MS3_PIN, ms3); break;
2758
+      #endif
2759
+      #if HAS_E5_MICROSTEPS && PIN_EXISTS(E5_MS3)
2760
+        case 8: WRITE(E5_MS3_PIN, ms3); break;
2761
+      #endif    
2762
+    }
2601 2763
   }
2602 2764
 
2603 2765
   void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) {
2604 2766
     switch (stepping_mode) {
2605
-      case 1: microstep_ms(driver, MICROSTEP1); break;
2606
-      #if ENABLED(HEROIC_STEPPER_DRIVERS)
2607
-        case 128: microstep_ms(driver, MICROSTEP128); break;
2608
-      #else
2767
+      #if HAS_MICROSTEP1
2768
+        case 1: microstep_ms(driver, MICROSTEP1); break;
2769
+      #endif
2770
+      #if HAS_MICROSTEP2
2609 2771
         case 2: microstep_ms(driver, MICROSTEP2); break;
2772
+      #endif
2773
+      #if HAS_MICROSTEP4
2610 2774
         case 4: microstep_ms(driver, MICROSTEP4); break;
2611 2775
       #endif
2612
-      case 8: microstep_ms(driver, MICROSTEP8); break;
2613
-      case 16: microstep_ms(driver, MICROSTEP16); break;
2614
-      #if MB(ALLIGATOR)
2776
+      #if HAS_MICROSTEP8
2777
+        case 8: microstep_ms(driver, MICROSTEP8); break;
2778
+      #endif
2779
+      #if HAS_MICROSTEP16
2780
+        case 16: microstep_ms(driver, MICROSTEP16); break;
2781
+      #endif
2782
+      #if HAS_MICROSTEP32
2615 2783
         case 32: microstep_ms(driver, MICROSTEP32); break;
2616 2784
       #endif
2785
+      #if HAS_MICROSTEP64
2786
+        case 64: microstep_ms(driver, MICROSTEP64); break;
2787
+      #endif
2788
+      #if HAS_MICROSTEP128
2789
+        case 128: microstep_ms(driver, MICROSTEP128); break;
2790
+      #endif
2791
+
2617 2792
       default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break;
2618 2793
     }
2619 2794
   }
2620 2795
 
2621 2796
   void Stepper::microstep_readings() {
2622
-    SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins");
2797
+    SERIAL_PROTOCOLLNPGM("MS1,MS2,MS3 Pins");
2623 2798
     SERIAL_PROTOCOLPGM("X: ");
2624
-    SERIAL_PROTOCOL(READ(X_MS1_PIN));
2625
-    SERIAL_PROTOCOLLN(READ(X_MS2_PIN));
2799
+    #if HAS_X_MICROSTEPS
2800
+      SERIAL_PROTOCOL(READ(X_MS1_PIN));
2801
+      SERIAL_PROTOCOL(READ(X_MS2_PIN));
2802
+      #if PIN_EXISTS(X_MS3)
2803
+        SERIAL_PROTOCOLLN(READ(X_MS3_PIN));
2804
+      #endif
2805
+    #endif
2626 2806
     #if HAS_Y_MICROSTEPS
2627 2807
       SERIAL_PROTOCOLPGM("Y: ");
2628 2808
       SERIAL_PROTOCOL(READ(Y_MS1_PIN));
2629
-      SERIAL_PROTOCOLLN(READ(Y_MS2_PIN));
2809
+      SERIAL_PROTOCOL(READ(Y_MS2_PIN));
2810
+      #if PIN_EXISTS(Y_MS3)
2811
+        SERIAL_PROTOCOLLN(READ(Y_MS3_PIN));
2812
+      #endif
2630 2813
     #endif
2631 2814
     #if HAS_Z_MICROSTEPS
2632 2815
       SERIAL_PROTOCOLPGM("Z: ");
2633 2816
       SERIAL_PROTOCOL(READ(Z_MS1_PIN));
2634
-      SERIAL_PROTOCOLLN(READ(Z_MS2_PIN));
2817
+      SERIAL_PROTOCOL(READ(Z_MS2_PIN));
2818
+      #if PIN_EXISTS(Z_MS3)
2819
+        SERIAL_PROTOCOLLN(READ(Z_MS3_PIN));
2820
+      #endif
2635 2821
     #endif
2636 2822
     #if HAS_E0_MICROSTEPS
2637 2823
       SERIAL_PROTOCOLPGM("E0: ");
2638 2824
       SERIAL_PROTOCOL(READ(E0_MS1_PIN));
2639
-      SERIAL_PROTOCOLLN(READ(E0_MS2_PIN));
2825
+      SERIAL_PROTOCOL(READ(E0_MS2_PIN));
2826
+      #if PIN_EXISTS(E0_MS3)
2827
+        SERIAL_PROTOCOLLN(READ(E0_MS3_PIN));
2828
+      #endif
2640 2829
     #endif
2641 2830
     #if HAS_E1_MICROSTEPS
2642 2831
       SERIAL_PROTOCOLPGM("E1: ");
2643 2832
       SERIAL_PROTOCOL(READ(E1_MS1_PIN));
2644
-      SERIAL_PROTOCOLLN(READ(E1_MS2_PIN));
2833
+      SERIAL_PROTOCOL(READ(E1_MS2_PIN));
2834
+      #if PIN_EXISTS(E1_MS3)
2835
+        SERIAL_PROTOCOLLN(READ(E1_MS3_PIN));
2836
+      #endif
2645 2837
     #endif
2646 2838
     #if HAS_E2_MICROSTEPS
2647 2839
       SERIAL_PROTOCOLPGM("E2: ");
2648 2840
       SERIAL_PROTOCOL(READ(E2_MS1_PIN));
2649
-      SERIAL_PROTOCOLLN(READ(E2_MS2_PIN));
2841
+      SERIAL_PROTOCOL(READ(E2_MS2_PIN));
2842
+      #if PIN_EXISTS(E2_MS3)
2843
+        SERIAL_PROTOCOLLN(READ(E2_MS3_PIN));
2844
+      #endif
2650 2845
     #endif
2651 2846
     #if HAS_E3_MICROSTEPS
2652 2847
       SERIAL_PROTOCOLPGM("E3: ");
2653 2848
       SERIAL_PROTOCOL(READ(E3_MS1_PIN));
2654
-      SERIAL_PROTOCOLLN(READ(E3_MS2_PIN));
2849
+      SERIAL_PROTOCOL(READ(E3_MS2_PIN));
2850
+      #if PIN_EXISTS(E3_MS3)
2851
+        SERIAL_PROTOCOLLN(READ(E3_MS3_PIN));
2852
+      #endif
2655 2853
     #endif
2656 2854
     #if HAS_E4_MICROSTEPS
2657 2855
       SERIAL_PROTOCOLPGM("E4: ");
2658 2856
       SERIAL_PROTOCOL(READ(E4_MS1_PIN));
2659
-      SERIAL_PROTOCOLLN(READ(E4_MS2_PIN));
2857
+      SERIAL_PROTOCOL(READ(E4_MS2_PIN));
2858
+      #if PIN_EXISTS(E4_MS3)
2859
+        SERIAL_PROTOCOLLN(READ(E4_MS3_PIN));
2860
+      #endif
2660 2861
     #endif
2661 2862
     #if HAS_E5_MICROSTEPS
2662 2863
       SERIAL_PROTOCOLPGM("E5: ");
2663 2864
       SERIAL_PROTOCOL(READ(E5_MS1_PIN));
2664 2865
       SERIAL_PROTOCOLLN(READ(E5_MS2_PIN));
2866
+      #if PIN_EXISTS(E5_MS3)
2867
+        SERIAL_PROTOCOLLN(READ(E5_MS3_PIN));
2868
+      #endif      
2665 2869
     #endif
2666 2870
   }
2667 2871
 

+ 1
- 1
Marlin/src/module/stepper.h View File

@@ -413,7 +413,7 @@ class Stepper {
413 413
     #endif
414 414
 
415 415
     #if HAS_MICROSTEPS
416
-      static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2);
416
+      static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3);
417 417
       static void microstep_mode(const uint8_t driver, const uint8_t stepping);
418 418
       static void microstep_readings();
419 419
     #endif

+ 74
- 164
Marlin/src/pins/pins.h View File

@@ -19,6 +19,7 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
+#pragma once
22 23
 
23 24
 /**
24 25
  * Include pins definitions
@@ -32,9 +33,6 @@
32 33
  *    These numbers are the same in any pin mapping.
33 34
  */
34 35
 
35
-#ifndef __PINS_H__
36
-#define __PINS_H__
37
-
38 36
 #define MAX_EXTRUDERS 6
39 37
 
40 38
 #if MB(RAMPS_13_EFB) || MB(RAMPS_14_EFB) || MB(RAMPS_PLUS_EFB) || MB(RAMPS_14_RE_ARM_EFB) || MB(RAMPS_SMART_EFB) || MB(RAMPS_DUO_EFB) || MB(RAMPS4DUE_EFB)
@@ -427,12 +425,18 @@
427 425
 #ifndef X_MS2_PIN
428 426
   #define X_MS2_PIN -1
429 427
 #endif
428
+#ifndef X_MS3_PIN
429
+  #define X_MS3_PIN -1
430
+#endif
430 431
 #ifndef Y_MS1_PIN
431 432
   #define Y_MS1_PIN -1
432 433
 #endif
433 434
 #ifndef Y_MS2_PIN
434 435
   #define Y_MS2_PIN -1
435 436
 #endif
437
+#ifndef Y_MS3_PIN
438
+  #define Y_MS3_PIN -1
439
+#endif
436 440
 #ifndef Z_MS1_PIN
437 441
   #define Z_MS1_PIN -1
438 442
 #endif
@@ -448,18 +452,27 @@
448 452
 #ifndef E0_MS2_PIN
449 453
   #define E0_MS2_PIN -1
450 454
 #endif
455
+#ifndef E0_MS3_PIN
456
+  #define E0_MS3_PIN -1
457
+#endif
451 458
 #ifndef E1_MS1_PIN
452 459
   #define E1_MS1_PIN -1
453 460
 #endif
454 461
 #ifndef E1_MS2_PIN
455 462
   #define E1_MS2_PIN -1
456 463
 #endif
464
+#ifndef E1_MS3_PIN
465
+  #define E1_MS3_PIN -1
466
+#endif
457 467
 #ifndef E2_MS1_PIN
458 468
   #define E2_MS1_PIN -1
459 469
 #endif
460 470
 #ifndef E2_MS2_PIN
461 471
   #define E2_MS2_PIN -1
462 472
 #endif
473
+#ifndef E2_MS3_PIN
474
+  #define E2_MS3_PIN -1
475
+#endif
463 476
 #ifndef E3_MS1_PIN
464 477
   #define E3_MS1_PIN -1
465 478
 #endif
@@ -650,7 +663,8 @@
650 663
 #ifndef LED_PIN
651 664
   #define LED_PIN -1
652 665
 #endif
653
-#ifndef PS_ON_PIN
666
+#if POWER_SUPPLY == 0 || !defined(PS_ON_PIN)
667
+  #undef PS_ON_PIN
654 668
   #define PS_ON_PIN -1
655 669
 #endif
656 670
 #ifndef KILL_PIN
@@ -717,94 +731,6 @@
717 731
   #endif
718 732
 #endif
719 733
 
720
-// List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
721
-#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, E0_CS_PIN,
722
-#define _E1_PINS
723
-#define _E2_PINS
724
-#define _E3_PINS
725
-#define _E4_PINS
726
-#define _E5_PINS
727
-
728
-#if ENABLED(SWITCHING_EXTRUDER)
729
-                      // Tools 0 and 1 use E0
730
-  #if EXTRUDERS > 2   // Tools 2 and 3 use E1
731
-    #undef _E1_PINS
732
-    #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
733
-    #if EXTRUDERS > 4 // Tools 4 and 5 use E2
734
-      #undef _E2_PINS
735
-      #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
736
-    #endif
737
-  #endif
738
-#elif EXTRUDERS > 1
739
-  #undef _E1_PINS
740
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
741
-  #if EXTRUDERS > 2
742
-    #undef _E2_PINS
743
-    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
744
-    #if EXTRUDERS > 3
745
-      #undef _E3_PINS
746
-      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_MS3_PIN, E3_CS_PIN,
747
-      #if EXTRUDERS > 4
748
-        #undef _E4_PINS
749
-        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_MS3_PIN, E4_CS_PIN,
750
-        #if EXTRUDERS > 5
751
-          #undef _E5_PINS
752
-          #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, E5_MS1_PIN, E5_MS2_PIN, E5_MS3_PIN, E5_CS_PIN,
753
-        #endif // EXTRUDERS > 5
754
-      #endif // EXTRUDERS > 4
755
-    #endif // EXTRUDERS > 3
756
-  #endif // EXTRUDERS > 2
757
-#endif // EXTRUDERS > 1
758
-
759
-#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
760
-#define _H1_PINS
761
-#define _H2_PINS
762
-#define _H3_PINS
763
-#define _H4_PINS
764
-#define _H5_PINS
765
-
766
-#if HOTENDS > 1
767
-  #undef _H1_PINS
768
-  #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
769
-  #if HOTENDS > 2
770
-    #undef _H2_PINS
771
-    #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
772
-    #if HOTENDS > 3
773
-      #undef _H3_PINS
774
-      #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
775
-      #if HOTENDS > 4
776
-        #undef _H4_PINS
777
-        #define _H4_PINS HEATER_4_PIN, E4_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_4_PIN),
778
-        #if HOTENDS > 5
779
-          #undef _H5_PINS
780
-          #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN),
781
-        #endif // HOTENDS > 5
782
-      #endif // HOTENDS > 4
783
-    #endif // HOTENDS > 3
784
-  #endif // HOTENDS > 2
785
-#elif ENABLED(MIXING_EXTRUDER)
786
-  #undef _E1_PINS
787
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
788
-  #if MIXING_STEPPERS > 2
789
-    #undef _E2_PINS
790
-    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
791
-    #if MIXING_STEPPERS > 3
792
-      #undef _E3_PINS
793
-      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_CS_PIN,
794
-      #if MIXING_STEPPERS > 4
795
-        #undef _E4_PINS
796
-        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_CS_PIN,
797
-        #if MIXING_STEPPERS > 5
798
-          #undef _E5_PINS
799
-          #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, E5_MS1_PIN, E5_MS2_PIN, E5_CS_PIN,
800
-        #endif // MIXING_STEPPERS > 5
801
-      #endif // MIXING_STEPPERS > 4
802
-    #endif // MIXING_STEPPERS > 3
803
-  #endif // MIXING_STEPPERS > 2
804
-#endif // MIXING_STEPPERS > 1
805
-
806
-#define BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
807
-
808 734
 //
809 735
 // Assign endstop pins for boards with only 3 connectors
810 736
 //
@@ -841,7 +767,7 @@
841 767
 //
842 768
 // Disable unused endstop / probe pins
843 769
 //
844
-#if DISABLED(Z_MIN_PROBE_ENDSTOP)
770
+#if !HAS_BED_PROBE || DISABLED(Z_MIN_PROBE_ENDSTOP)
845 771
   #undef Z_MIN_PROBE_PIN
846 772
   #define Z_MIN_PROBE_PIN    -1
847 773
 #endif
@@ -889,14 +815,13 @@
889 815
   #define LCD_PINS_D7 -1
890 816
 #endif
891 817
 
892
-//
893
-// Dual X-carriage, Dual Y, Dual Z support
894
-//
895
-
896
-#define _X2_PINS
897
-#define _Y2_PINS
898
-#define _Z2_PINS
899
-#define _Z3_PINS
818
+/**
819
+ * Auto-Assignment for Dual X, Dual Y, Multi-Z Steppers
820
+ *
821
+ * By default X2 is assigned to the next open E plug
822
+ * on the board, then in order, Y2, Z2, Z3. These can be
823
+ * overridden in Configuration.h or Configuration_adv.h.
824
+ */
900 825
 
901 826
 #define __EPIN(p,q) E##p##_##q##_PIN
902 827
 #define _EPIN(p,q) __EPIN(p,q)
@@ -907,19 +832,21 @@
907 832
     #define X2_STEP_PIN   _EPIN(E_STEPPERS, STEP)
908 833
     #define X2_DIR_PIN    _EPIN(E_STEPPERS, DIR)
909 834
     #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
910
-    #ifndef X2_CS_PIN
911
-      #define X2_CS_PIN   _EPIN(E_STEPPERS, CS)
912
-    #endif
913
-    #if E_STEPPERS > MAX_EXTRUDERS || !PIN_EXISTS(X2_ENABLE)
835
+    #if E_STEPPERS >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP)
914 836
       #error "No E stepper plug left for X2!"
915 837
     #endif
916 838
   #endif
917
-  #undef _X2_PINS
918
-  #define __X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN,
919
-  #ifdef X2_CS_PIN
920
-    #define _X2_PINS __X2_PINS X2_CS_PIN,
921
-  #else
922
-    #define _X2_PINS __X2_PINS
839
+  #ifndef X2_CS_PIN
840
+    #define X2_CS_PIN     _EPIN(E_STEPPERS, CS)
841
+  #endif
842
+  #ifndef X2_MS1_PIN
843
+    #define X2_MS1_PIN    _EPIN(E_STEPPERS, MS1)
844
+  #endif
845
+  #ifndef X2_MS2_PIN
846
+    #define X2_MS2_PIN    _EPIN(E_STEPPERS, MS2)
847
+  #endif
848
+  #ifndef X2_MS3_PIN
849
+    #define X2_MS3_PIN    _EPIN(E_STEPPERS, MS3)
923 850
   #endif
924 851
   #define Y2_E_INDEX INCREMENT(E_STEPPERS)
925 852
 #else
@@ -932,19 +859,21 @@
932 859
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
933 860
     #define Y2_DIR_PIN    _EPIN(Y2_E_INDEX, DIR)
934 861
     #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
935
-    #ifndef Y2_CS_PIN
936
-      #define Y2_CS_PIN   _EPIN(Y2_E_INDEX, CS)
937
-    #endif
938
-    #if Y2_E_INDEX > MAX_EXTRUDERS || !PIN_EXISTS(Y2_ENABLE)
862
+    #if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_STEP)
939 863
       #error "No E stepper plug left for Y2!"
940 864
     #endif
941 865
   #endif
942
-  #undef _Y2_PINS
943
-  #define __Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN,
944
-  #ifdef Y2_CS_PIN
945
-    #define _Y2_PINS __Y2_PINS Y2_CS_PIN,
946
-  #else
947
-    #define _Y2_PINS __Y2_PINS
866
+  #ifndef Y2_CS_PIN
867
+    #define Y2_CS_PIN     _EPIN(Y2_E_INDEX, CS)
868
+  #endif
869
+  #ifndef Y2_MS1_PIN
870
+    #define Y2_MS1_PIN    _EPIN(Y2_E_INDEX, MS1)
871
+  #endif
872
+  #ifndef Y2_MS2_PIN
873
+    #define Y2_MS2_PIN    _EPIN(Y2_E_INDEX, MS2)
874
+  #endif
875
+  #ifndef Y2_MS3_PIN
876
+    #define Y2_MS3_PIN    _EPIN(Y2_E_INDEX, MS3)
948 877
   #endif
949 878
   #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
950 879
 #else
@@ -957,19 +886,21 @@
957 886
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
958 887
     #define Z2_DIR_PIN    _EPIN(Z2_E_INDEX, DIR)
959 888
     #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
960
-    #ifndef Z2_CS_PIN
961
-      #define Z2_CS_PIN   _EPIN(Z2_E_INDEX, CS)
962
-    #endif
963
-    #if Z2_E_INDEX > MAX_EXTRUDERS || !PIN_EXISTS(Z2_ENABLE)
889
+    #if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_STEP)
964 890
       #error "No E stepper plug left for Z2!"
965 891
     #endif
966 892
   #endif
967
-  #undef _Z2_PINS
968
-  #define __Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN,
969
-  #ifdef Z2_CS_PIN
970
-    #define _Z2_PINS __Z2_PINS Z2_CS_PIN,
971
-  #else
972
-    #define _Z2_PINS __Z2_PINS
893
+  #ifndef Z2_CS_PIN
894
+    #define Z2_CS_PIN     _EPIN(Z2_E_INDEX, CS)
895
+  #endif
896
+  #ifndef Z2_MS1_PIN
897
+    #define Z2_MS1_PIN    _EPIN(Z2_E_INDEX, MS1)
898
+  #endif
899
+  #ifndef Z2_MS2_PIN
900
+    #define Z2_MS2_PIN    _EPIN(Z2_E_INDEX, MS2)
901
+  #endif
902
+  #ifndef Z2_MS3_PIN
903
+    #define Z2_MS3_PIN    _EPIN(Z2_E_INDEX, MS3)
973 904
   #endif
974 905
   #define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
975 906
 #else
@@ -981,41 +912,20 @@
981 912
     #define Z3_STEP_PIN   _EPIN(Z3_E_INDEX, STEP)
982 913
     #define Z3_DIR_PIN    _EPIN(Z3_E_INDEX, DIR)
983 914
     #define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE)
984
-    #ifndef Z3_CS_PIN
985
-      #define Z3_CS_PIN   _EPIN(Z3_E_INDEX, CS)
986
-    #endif
987
-    #if Z3_E_INDEX > 4 || !PIN_EXISTS(Z3_ENABLE)
915
+    #if Z3_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z3_STEP)
988 916
       #error "No E stepper plug left for Z3!"
989 917
     #endif
990 918
   #endif
991
-  #undef _Z3_PINS
992
-  #define __Z3_PINS Z3_STEP_PIN, Z3_DIR_PIN, Z3_ENABLE_PIN,
993
-  #ifdef Z3_CS_PIN
994
-    #define _Z3_PINS __Z3_PINS Z3_CS_PIN,
995
-  #else
996
-    #define _Z3_PINS __Z3_PINS
919
+  #ifndef Z3_CS_PIN
920
+    #define Z3_CS_PIN     _EPIN(Z3_E_INDEX, CS)
921
+  #endif
922
+  #ifndef Z3_MS1_PIN
923
+    #define Z3_MS1_PIN    _EPIN(Z3_E_INDEX, MS1)
924
+  #endif
925
+  #ifndef Z3_MS2_PIN
926
+    #define Z3_MS2_PIN    _EPIN(Z3_E_INDEX, MS2)
927
+  #endif
928
+  #ifndef Z3_MS3_PIN
929
+    #define Z3_MS3_PIN    _EPIN(Z3_E_INDEX, MS3)
997 930
   #endif
998 931
 #endif
999
-
1000
-#ifndef HAL_SENSITIVE_PINS
1001
-  #define HAL_SENSITIVE_PINS
1002
-#endif
1003
-
1004
-#define SENSITIVE_PINS { \
1005
-    X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, X_MS1_PIN, X_MS2_PIN, X_CS_PIN, \
1006
-    Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Y_MS1_PIN, Y_MS2_PIN, Y_CS_PIN, \
1007
-    Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MS1_PIN, Z_MS2_PIN, Z_MS3_PIN, Z_CS_PIN, Z_MIN_PROBE_PIN, \
1008
-    PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \
1009
-    _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS BED_PINS \
1010
-    _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS \
1011
-    _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS \
1012
-    HAL_SENSITIVE_PINS \
1013
-  }
1014
-
1015
-#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
1016
-
1017
-// Note: default SPI pins are defined in the HAL
1018
-
1019
-#include HAL_PATH(../HAL, spi_pins.h)
1020
-
1021
-#endif // __PINS_H__

+ 36
- 0
Marlin/src/pins/pinsDebug_list.h View File

@@ -268,6 +268,9 @@
268 268
 #if PIN_EXISTS(E0_MS2)
269 269
   REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN)
270 270
 #endif
271
+#if PIN_EXISTS(E0_MS3)
272
+  REPORT_NAME_DIGITAL(__LINE__, E0_MS3_PIN)
273
+#endif
271 274
 #if PIN_EXISTS(E0_STEP)
272 275
   REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN)
273 276
 #endif
@@ -289,6 +292,9 @@
289 292
 #if PIN_EXISTS(E1_MS2)
290 293
   REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN)
291 294
 #endif
295
+#if PIN_EXISTS(E1_MS3)
296
+  REPORT_NAME_DIGITAL(__LINE__, E1_MS3_PIN)
297
+#endif
292 298
 #if PIN_EXISTS(E1_STEP)
293 299
   REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN)
294 300
 #endif
@@ -310,6 +316,9 @@
310 316
 #if PIN_EXISTS(E2_MS2)
311 317
   REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN)
312 318
 #endif
319
+#if PIN_EXISTS(E2_MS3)
320
+  REPORT_NAME_DIGITAL(__LINE__, E2_MS3_PIN)
321
+#endif
313 322
 #if PIN_EXISTS(E2_STEP)
314 323
   REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN)
315 324
 #endif
@@ -881,6 +890,9 @@
881 890
 #if PIN_EXISTS(X_MS2)
882 891
   REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN)
883 892
 #endif
893
+#if PIN_EXISTS(X_MS3)
894
+  REPORT_NAME_DIGITAL(__LINE__, X_MS3_PIN)
895
+#endif
884 896
 #if PIN_EXISTS(X_STEP)
885 897
   REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN)
886 898
 #endif
@@ -893,6 +905,15 @@
893 905
 #if PIN_EXISTS(X2_ENABLE)
894 906
   REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN)
895 907
 #endif
908
+#if PIN_EXISTS(X2_MS1)
909
+  REPORT_NAME_DIGITAL(__LINE__, X2_MS1_PIN)
910
+#endif
911
+#if PIN_EXISTS(X2_MS2)
912
+  REPORT_NAME_DIGITAL(__LINE__, X2_MS2_PIN)
913
+#endif
914
+#if PIN_EXISTS(X2_MS3)
915
+  REPORT_NAME_DIGITAL(__LINE__, X2_MS3_PIN)
916
+#endif
896 917
 #if PIN_EXISTS(X2_STEP)
897 918
   REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN)
898 919
 #endif
@@ -920,6 +941,9 @@
920 941
 #if PIN_EXISTS(Y_MS2)
921 942
   REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN)
922 943
 #endif
944
+#if PIN_EXISTS(Y_MS3)
945
+  REPORT_NAME_DIGITAL(__LINE__, Y_MS3_PIN)
946
+#endif
923 947
 #if PIN_EXISTS(Y_STEP)
924 948
   REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN)
925 949
 #endif
@@ -932,6 +956,15 @@
932 956
 #if PIN_EXISTS(Y2_ENABLE)
933 957
   REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN)
934 958
 #endif
959
+#if PIN_EXISTS(Y2_MS1)
960
+  REPORT_NAME_DIGITAL(__LINE__, Y2_MS1_PIN)
961
+#endif
962
+#if PIN_EXISTS(Y2_MS2)
963
+  REPORT_NAME_DIGITAL(__LINE__, Y2_MS2_PIN)
964
+#endif
965
+#if PIN_EXISTS(Y2_MS3)
966
+  REPORT_NAME_DIGITAL(__LINE__, Y2_MS3_PIN)
967
+#endif
935 968
 #if PIN_EXISTS(Y2_STEP)
936 969
   REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN)
937 970
 #endif
@@ -962,6 +995,9 @@
962 995
 #if PIN_EXISTS(Z_MS2)
963 996
   REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN)
964 997
 #endif
998
+#if PIN_EXISTS(Z_MS3)
999
+  REPORT_NAME_DIGITAL(__LINE__, Z_MS3_PIN)
1000
+#endif
965 1001
 #if PIN_EXISTS(Z_STEP)
966 1002
   REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN)
967 1003
 #endif

+ 0
- 3
Marlin/src/pins/pins_RURAMPS4D_11.h View File

@@ -119,9 +119,6 @@
119 119
 //#define E3_MS1_PIN         ?
120 120
 //#define E3_MS2_PIN         ?
121 121
 //#define E3_MS3_PIN         ?
122
-//#define Z2_MS1_PIN         ?   // shared with E3_MS1_PIN
123
-//#define Z2_MS2_PIN         ?   // shared with E3_MS2_PIN
124
-//#define Z2_MS3_PIN         ?   // shared with E3_MS3_PIN
125 122
 
126 123
 #if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
127 124
   #define Z_MIN_PROBE_PIN  49

+ 516
- 0
Marlin/src/pins/sensitive_pins.h View File

@@ -0,0 +1,516 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+//
25
+// Prepare a list of protected pins for M42/M43
26
+//
27
+
28
+#if PIN_EXISTS(X_MIN)
29
+  #define _X_MIN X_MIN_PIN,
30
+#else
31
+  #define _X_MIN
32
+#endif
33
+#if PIN_EXISTS(X_MAX)
34
+  #define _X_MAX X_MAX_PIN,
35
+#else
36
+  #define _X_MAX
37
+#endif
38
+#if PIN_EXISTS(X_CS)
39
+  #define _X_CS X_CS_PIN,
40
+#else
41
+  #define _X_CS
42
+#endif
43
+#if PIN_EXISTS(X_MS1)
44
+  #define _X_MS1 X_MS1_PIN,
45
+#else
46
+  #define _X_MS1
47
+#endif
48
+#if PIN_EXISTS(X_MS2)
49
+  #define _X_MS2 X_MS2_PIN,
50
+#else
51
+  #define _X_MS2
52
+#endif
53
+#if PIN_EXISTS(X_MS3)
54
+  #define _X_MS3 X_MS3_PIN,
55
+#else
56
+  #define _X_MS3
57
+#endif
58
+
59
+#define _X_PINS X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, _X_MIN _X_MAX _X_MS1 _X_MS2 _X_MS3 _X_CS
60
+
61
+#if PIN_EXISTS(Y_MIN)
62
+  #define _Y_MIN Y_MIN_PIN,
63
+#else
64
+  #define _Y_MIN
65
+#endif
66
+#if PIN_EXISTS(Y_MAX)
67
+  #define _Y_MAX Y_MAX_PIN,
68
+#else
69
+  #define _Y_MAX
70
+#endif
71
+#if PIN_EXISTS(Y_CS)
72
+  #define _Y_CS Y_CS_PIN,
73
+#else
74
+  #define _Y_CS
75
+#endif
76
+#if PIN_EXISTS(Y_MS1)
77
+  #define _Y_MS1 Y_MS1_PIN,
78
+#else
79
+  #define _Y_MS1
80
+#endif
81
+#if PIN_EXISTS(Y_MS2)
82
+  #define _Y_MS2 Y_MS2_PIN,
83
+#else
84
+  #define _Y_MS2
85
+#endif
86
+#if PIN_EXISTS(Y_MS3)
87
+  #define _Y_MS3 Y_MS3_PIN,
88
+#else
89
+  #define _Y_MS3
90
+#endif
91
+
92
+#define _Y_PINS Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, _Y_MIN _Y_MAX _Y_MS1 _Y_MS2 _Y_MS3 _Y_CS
93
+
94
+#if PIN_EXISTS(Z_MIN)
95
+  #define _Z_MIN Z_MIN_PIN,
96
+#else
97
+  #define _Z_MIN
98
+#endif
99
+#if PIN_EXISTS(Z_MAX)
100
+  #define _Z_MAX Z_MAX_PIN,
101
+#else
102
+  #define _Z_MAX
103
+#endif
104
+#if PIN_EXISTS(Z_CS)
105
+  #define _Z_CS Z_CS_PIN,
106
+#else
107
+  #define _Z_CS
108
+#endif
109
+#if PIN_EXISTS(Z_MS1)
110
+  #define _Z_MS1 Z_MS1_PIN,
111
+#else
112
+  #define _Z_MS1
113
+#endif
114
+#if PIN_EXISTS(Z_MS2)
115
+  #define _Z_MS2 Z_MS2_PIN,
116
+#else
117
+  #define _Z_MS2
118
+#endif
119
+#if PIN_EXISTS(Z_MS3)
120
+  #define _Z_MS3 Z_MS3_PIN,
121
+#else
122
+  #define _Z_MS3
123
+#endif
124
+
125
+#define _Z_PINS Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, _Z_MIN _Z_MAX _Z_MS1 _Z_MS2 _Z_MS3 _Z_CS
126
+
127
+//
128
+// Extruder Chip Select, Digital Micro-steps
129
+//
130
+
131
+// Mixing stepper, Switching stepper, or regular stepper
132
+#define E_NEEDED(N) (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > N) \
133
+                 || (ENABLED(SWITCHING_EXTRUDER) && E_STEPPERS > N) \
134
+                 || (DISABLED(SWITCHING_EXTRUDER) && DISABLED(MIXING_EXTRUDER) && EXTRUDERS > N)
135
+
136
+#if PIN_EXISTS(E0_CS)
137
+  #define _E0_CS E0_CS_PIN,
138
+#else
139
+  #define _E0_CS
140
+#endif
141
+#if PIN_EXISTS(E0_MS1)
142
+  #define _E0_MS1 E0_MS1_PIN,
143
+#else
144
+  #define _E0_MS1
145
+#endif
146
+#if PIN_EXISTS(E0_MS2)
147
+  #define _E0_MS2 E0_MS2_PIN,
148
+#else
149
+  #define _E0_MS2
150
+#endif
151
+#if PIN_EXISTS(E0_MS3)
152
+  #define _E0_MS3 E0_MS3_PIN,
153
+#else
154
+  #define _E0_MS3
155
+#endif
156
+
157
+#define _E1_CS
158
+#define _E1_MS1
159
+#define _E1_MS2
160
+#define _E1_MS3
161
+
162
+#if E_NEEDED(1)
163
+  #if PIN_EXISTS(E1_CS)
164
+    #undef _E1_CS
165
+    #define _E1_CS E1_CS_PIN,
166
+  #endif
167
+  #if PIN_EXISTS(E1_MS1)
168
+    #undef _E1_MS1
169
+    #define _E1_MS1 E1_MS1_PIN,
170
+  #endif
171
+  #if PIN_EXISTS(E1_MS2)
172
+    #undef _E1_MS2
173
+    #define _E1_MS2 E1_MS2_PIN,
174
+  #endif
175
+  #if PIN_EXISTS(E1_MS3)
176
+    #undef _E1_MS3
177
+    #define _E1_MS3 E1_MS3_PIN,
178
+  #endif
179
+#endif
180
+
181
+#define _E2_CS
182
+#define _E2_MS1
183
+#define _E2_MS2
184
+#define _E2_MS3
185
+
186
+#if E_NEEDED(2)
187
+  #if PIN_EXISTS(E2_CS)
188
+    #undef _E2_CS
189
+    #define _E2_CS E2_CS_PIN,
190
+  #endif
191
+  #if PIN_EXISTS(E2_MS1)
192
+    #undef _E2_MS1
193
+    #define _E2_MS1 E2_MS1_PIN,
194
+  #endif
195
+  #if PIN_EXISTS(E2_MS2)
196
+    #undef _E2_MS2
197
+    #define _E2_MS2 E2_MS2_PIN,
198
+  #endif
199
+  #if PIN_EXISTS(E2_MS3)
200
+    #undef _E2_MS3
201
+    #define _E2_MS3 E2_MS3_PIN,
202
+  #endif
203
+#endif
204
+
205
+#define _E3_CS
206
+#define _E3_MS1
207
+#define _E3_MS2
208
+#define _E3_MS3
209
+
210
+#if E_NEEDED(3)
211
+  #if PIN_EXISTS(E3_CS)
212
+    #undef _E3_CS
213
+    #define _E3_CS E3_CS_PIN,
214
+  #endif
215
+  #if PIN_EXISTS(E3_MS1)
216
+    #undef _E3_MS1
217
+    #define _E3_MS1 E3_MS1_PIN,
218
+  #endif
219
+  #if PIN_EXISTS(E3_MS2)
220
+    #undef _E3_MS2
221
+    #define _E3_MS2 E3_MS2_PIN,
222
+  #endif
223
+  #if PIN_EXISTS(E3_MS3)
224
+    #undef _E3_MS3
225
+    #define _E3_MS3 E3_MS3_PIN,
226
+  #endif
227
+#endif
228
+
229
+#define _E4_CS
230
+#define _E4_MS1
231
+#define _E4_MS2
232
+#define _E4_MS3
233
+
234
+#if E_NEEDED(4)
235
+  #if PIN_EXISTS(E4_CS)
236
+    #undef _E4_CS
237
+    #define _E4_CS E4_CS_PIN,
238
+  #endif
239
+  #if PIN_EXISTS(E4_MS1)
240
+    #undef _E4_MS1
241
+    #define _E4_MS1 E4_MS1_PIN,
242
+  #endif
243
+  #if PIN_EXISTS(E4_MS2)
244
+    #undef _E4_MS2
245
+    #define _E4_MS2 E4_MS2_PIN,
246
+  #endif
247
+  #if PIN_EXISTS(E4_MS3)
248
+    #undef _E4_MS3
249
+    #define _E4_MS3 E4_MS3_PIN,
250
+  #endif
251
+#endif
252
+
253
+#define _E5_CS
254
+#define _E5_MS1
255
+#define _E5_MS2
256
+#define _E5_MS3
257
+
258
+#if E_NEEDED(5)
259
+  #if PIN_EXISTS(E5_CS)
260
+    #undef _E5_CS
261
+    #define _E5_CS E5_CS_PIN,
262
+  #endif
263
+  #if PIN_EXISTS(E5_MS1)
264
+    #undef _E5_MS1
265
+    #define _E5_MS1 E5_MS1_PIN,
266
+  #endif
267
+  #if PIN_EXISTS(E5_MS2)
268
+    #undef _E5_MS2
269
+    #define _E5_MS2 E5_MS2_PIN,
270
+  #endif
271
+  #if PIN_EXISTS(E5_MS3)
272
+    #undef _E5_MS3
273
+    #define _E5_MS3 E5_MS3_PIN,
274
+  #endif
275
+#endif
276
+
277
+//
278
+// E Steppers
279
+//
280
+
281
+#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, _E0_CS _E0_MS1 _E0_MS2 _E0_MS3
282
+#define _E1_PINS
283
+#define _E2_PINS
284
+#define _E3_PINS
285
+#define _E4_PINS
286
+#define _E5_PINS
287
+
288
+#if ENABLED(SWITCHING_EXTRUDER)
289
+                      // Tools 0 and 1 use E0
290
+  #if EXTRUDERS > 2   // Tools 2 and 3 use E1
291
+    #undef _E1_PINS
292
+    #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3
293
+    #if EXTRUDERS > 4 // Tools 4 and 5 use E2
294
+      #undef _E2_PINS
295
+      #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, _E2_CS _E2_MS1 _E2_MS2 _E2_MS3
296
+    #endif
297
+  #endif
298
+#elif EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER)
299
+  #undef _E1_PINS
300
+  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3
301
+  #if EXTRUDERS > 2 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 2)
302
+    #undef _E2_PINS
303
+    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, _E2_CS _E2_MS1 _E2_MS2 _E2_MS3
304
+    #if EXTRUDERS > 3 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 3)
305
+      #undef _E3_PINS
306
+      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, _E3_CS _E3_MS1 _E3_MS2 _E3_MS3
307
+      #if EXTRUDERS > 4 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 4)
308
+        #undef _E4_PINS
309
+        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, _E4_CS _E4_MS1 _E4_MS2 _E4_MS3
310
+        #if EXTRUDERS > 5 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 5)
311
+          #undef _E5_PINS
312
+          #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, _E5_CS _E5_MS1 _E5_MS2 _E5_MS3
313
+        #endif // EXTRUDERS > 5 || MIXING_EXTRUDER > 5
314
+      #endif // EXTRUDERS > 4 || MIXING_EXTRUDER > 4
315
+    #endif // EXTRUDERS > 3 || MIXING_EXTRUDER > 3
316
+  #endif // EXTRUDERS > 2 || MIXING_EXTRUDER > 2
317
+#endif // EXTRUDERS > 1 || MIXING_EXTRUDER
318
+
319
+//
320
+// Heaters, Fans, Temp Sensors
321
+//
322
+
323
+#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
324
+#define _H1_PINS
325
+#define _H2_PINS
326
+#define _H3_PINS
327
+#define _H4_PINS
328
+#define _H5_PINS
329
+
330
+#if HOTENDS > 1
331
+  #undef _H1_PINS
332
+  #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
333
+  #if HOTENDS > 2
334
+    #undef _H2_PINS
335
+    #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
336
+    #if HOTENDS > 3
337
+      #undef _H3_PINS
338
+      #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
339
+      #if HOTENDS > 4
340
+        #undef _H4_PINS
341
+        #define _H4_PINS HEATER_4_PIN, E4_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_4_PIN),
342
+        #if HOTENDS > 5
343
+          #undef _H5_PINS
344
+          #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN),
345
+        #endif // HOTENDS > 5
346
+      #endif // HOTENDS > 4
347
+    #endif // HOTENDS > 3
348
+  #endif // HOTENDS > 2
349
+#endif // HOTENDS > 1
350
+
351
+#define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
352
+
353
+//
354
+// Dual X, Dual Y, Multi-Z
355
+// Chip Select and Digital Micro-stepping
356
+//
357
+
358
+#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)
359
+  #if PIN_EXISTS(X2_CS)
360
+    #define _X2_CS X2_CS_PIN,
361
+  #else
362
+    #define _X2_CS
363
+  #endif
364
+  #if PIN_EXISTS(X2_MS1)
365
+    #define _X2_MS1 X2_MS1_PIN,
366
+  #else
367
+    #define _X2_MS1
368
+  #endif
369
+  #if PIN_EXISTS(X2_MS2)
370
+    #define _X2_MS2 X2_MS2_PIN,
371
+  #else
372
+    #define _X2_MS2
373
+  #endif
374
+  #if PIN_EXISTS(X2_MS3)
375
+    #define _X2_MS3 X2_MS3_PIN,
376
+  #else
377
+    #define _X2_MS3
378
+  #endif
379
+  #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, _X2_CS _X2_MS1 _X2_MS2 _X2_MS3
380
+#else
381
+  #define _X2_PINS
382
+#endif
383
+
384
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
385
+  #if PIN_EXISTS(Y2_CS)
386
+    #define _Y2_CS Y2_CS_PIN,
387
+  #else
388
+    #define _Y2_CS
389
+  #endif
390
+  #if PIN_EXISTS(Y2_MS1)
391
+    #define _Y2_MS1 Y2_MS1_PIN,
392
+  #else
393
+    #define _Y2_MS1
394
+  #endif
395
+  #if PIN_EXISTS(Y2_MS2)
396
+    #define _Y2_MS2 Y2_MS2_PIN,
397
+  #else
398
+    #define _Y2_MS2
399
+  #endif
400
+  #if PIN_EXISTS(Y2_MS3)
401
+    #define _Y2_MS3 Y2_MS3_PIN,
402
+  #else
403
+    #define _Y2_MS3
404
+  #endif
405
+  #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, _Y2_CS _Y2_MS1 _Y2_MS2 _Y2_MS3
406
+#else
407
+  #define _Y2_PINS
408
+#endif
409
+
410
+#if Z_MULTI_STEPPER_DRIVERS
411
+  #if PIN_EXISTS(Z2_CS)
412
+    #define _Z2_CS Z2_CS_PIN,
413
+  #else
414
+    #define _Z2_CS
415
+  #endif
416
+  #if PIN_EXISTS(Z2_MS1)
417
+    #define _Z2_MS1 Z2_MS1_PIN,
418
+  #else
419
+    #define _Z2_MS1
420
+  #endif
421
+  #if PIN_EXISTS(Z2_MS2)
422
+    #define _Z2_MS2 Z2_MS2_PIN,
423
+  #else
424
+    #define _Z2_MS2
425
+  #endif
426
+  #if PIN_EXISTS(Z2_MS3)
427
+    #define _Z2_MS3 Z2_MS3_PIN,
428
+  #else
429
+    #define _Z2_MS3
430
+  #endif
431
+  #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, _Z2_CS _Z2_MS1 _Z2_MS2 _Z2_MS3
432
+#else
433
+  #define _Z2_PINS
434
+#endif
435
+
436
+#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
437
+  #if PIN_EXISTS(Z3_CS)
438
+    #define _Z3_CS Z3_CS_PIN,
439
+  #else
440
+    #define _Z3_CS
441
+  #endif
442
+  #if PIN_EXISTS(Z3_MS1)
443
+    #define _Z3_MS1 Z3_MS1_PIN,
444
+  #else
445
+    #define _Z3_MS1
446
+  #endif
447
+  #if PIN_EXISTS(Z3_MS2)
448
+    #define _Z3_MS2 Z3_MS2_PIN,
449
+  #else
450
+    #define _Z3_MS2
451
+  #endif
452
+  #if PIN_EXISTS(Z3_MS3)
453
+    #define _Z3_MS3 Z3_MS3_PIN,
454
+  #else
455
+    #define _Z3_MS3
456
+  #endif
457
+  #define _Z3_PINS Z3_STEP_PIN, Z3_DIR_PIN, Z3_ENABLE_PIN, _Z3_CS _Z3_MS1 _Z3_MS2 _Z3_MS3
458
+#else
459
+  #define _Z3_PINS
460
+#endif
461
+
462
+//
463
+// Generate the final Sensitive Pins array,
464
+// keeping the array as small as possible.
465
+//
466
+
467
+#if PIN_EXISTS(PS_ON)
468
+  #define _PS_ON PS_ON_PIN,
469
+#else
470
+  #define _PS_ON
471
+#endif
472
+
473
+#if HAS_BED_PROBE && PIN_EXISTS(Z_MIN_PROBE)
474
+  #define _Z_PROBE Z_MIN_PROBE_PIN,
475
+#else
476
+  #define _Z_PROBE
477
+#endif
478
+
479
+#if TEMP_SENSOR_BED && PIN_EXISTS(HEATER_BED)
480
+  #define _HEATER_BED HEATER_BED_PIN,
481
+#else
482
+  #define _HEATER_BED
483
+#endif
484
+
485
+#if PIN_EXISTS(FAN)
486
+  #define _FAN0 FAN_PIN,
487
+#else
488
+  #define _FAN0
489
+#endif
490
+#if PIN_EXISTS(FAN1)
491
+  #define _FAN1 FAN1_PIN,
492
+#else
493
+  #define _FAN1
494
+#endif
495
+#if PIN_EXISTS(FAN2)
496
+  #define _FAN2 FAN2_PIN,
497
+#else
498
+  #define _FAN2
499
+#endif
500
+#if PIN_EXISTS(CONTROLLER_FAN)
501
+  #define _FANC CONTROLLER_FAN_PIN,
502
+#else
503
+  #define _FANC
504
+#endif
505
+
506
+#ifndef HAL_SENSITIVE_PINS
507
+  #define HAL_SENSITIVE_PINS
508
+#endif
509
+
510
+#define SENSITIVE_PINS { \
511
+  _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z_PROBE \
512
+  _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _BED_PINS \
513
+  _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS \
514
+  _PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FANC \
515
+  HAL_SENSITIVE_PINS \
516
+}

Loading…
Cancel
Save