Bladeren bron

Move SENSITIVE_PINS to its own file

Scott Lahteine 6 jaren geleden
bovenliggende
commit
1407afad73
4 gewijzigde bestanden met toevoegingen van 532 en 124 verwijderingen
  1. 3
    0
      Marlin/src/Marlin.cpp
  2. 2
    0
      Marlin/src/inc/MarlinConfig.h
  3. 11
    124
      Marlin/src/pins/pins.h
  4. 516
    0
      Marlin/src/pins/sensitive_pins.h

+ 3
- 0
Marlin/src/Marlin.cpp Bestand weergeven

@@ -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++) {

+ 2
- 0
Marlin/src/inc/MarlinConfig.h Bestand weergeven

@@ -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

+ 11
- 124
Marlin/src/pins/pins.h Bestand weergeven

@@ -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)
@@ -665,7 +663,8 @@
665 663
 #ifndef LED_PIN
666 664
   #define LED_PIN -1
667 665
 #endif
668
-#ifndef PS_ON_PIN
666
+#if POWER_SUPPLY == 0 || !defined(PS_ON_PIN)
667
+  #undef PS_ON_PIN
669 668
   #define PS_ON_PIN -1
670 669
 #endif
671 670
 #ifndef KILL_PIN
@@ -732,94 +731,6 @@
732 731
   #endif
733 732
 #endif
734 733
 
735
-// List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
736
-#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, E0_CS_PIN,
737
-#define _E1_PINS
738
-#define _E2_PINS
739
-#define _E3_PINS
740
-#define _E4_PINS
741
-#define _E5_PINS
742
-
743
-#if ENABLED(SWITCHING_EXTRUDER)
744
-                      // Tools 0 and 1 use E0
745
-  #if EXTRUDERS > 2   // Tools 2 and 3 use E1
746
-    #undef _E1_PINS
747
-    #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
748
-    #if EXTRUDERS > 4 // Tools 4 and 5 use E2
749
-      #undef _E2_PINS
750
-      #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
751
-    #endif
752
-  #endif
753
-#elif EXTRUDERS > 1
754
-  #undef _E1_PINS
755
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
756
-  #if EXTRUDERS > 2
757
-    #undef _E2_PINS
758
-    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
759
-    #if EXTRUDERS > 3
760
-      #undef _E3_PINS
761
-      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_MS3_PIN, E3_CS_PIN,
762
-      #if EXTRUDERS > 4
763
-        #undef _E4_PINS
764
-        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_MS3_PIN, E4_CS_PIN,
765
-        #if EXTRUDERS > 5
766
-          #undef _E5_PINS
767
-          #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, E5_MS1_PIN, E5_MS2_PIN, E5_MS3_PIN, E5_CS_PIN,
768
-        #endif // EXTRUDERS > 5
769
-      #endif // EXTRUDERS > 4
770
-    #endif // EXTRUDERS > 3
771
-  #endif // EXTRUDERS > 2
772
-#endif // EXTRUDERS > 1
773
-
774
-#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
775
-#define _H1_PINS
776
-#define _H2_PINS
777
-#define _H3_PINS
778
-#define _H4_PINS
779
-#define _H5_PINS
780
-
781
-#if HOTENDS > 1
782
-  #undef _H1_PINS
783
-  #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
784
-  #if HOTENDS > 2
785
-    #undef _H2_PINS
786
-    #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
787
-    #if HOTENDS > 3
788
-      #undef _H3_PINS
789
-      #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
790
-      #if HOTENDS > 4
791
-        #undef _H4_PINS
792
-        #define _H4_PINS HEATER_4_PIN, E4_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_4_PIN),
793
-        #if HOTENDS > 5
794
-          #undef _H5_PINS
795
-          #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN),
796
-        #endif // HOTENDS > 5
797
-      #endif // HOTENDS > 4
798
-    #endif // HOTENDS > 3
799
-  #endif // HOTENDS > 2
800
-#elif ENABLED(MIXING_EXTRUDER)
801
-  #undef _E1_PINS
802
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
803
-  #if MIXING_STEPPERS > 2
804
-    #undef _E2_PINS
805
-    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
806
-    #if MIXING_STEPPERS > 3
807
-      #undef _E3_PINS
808
-      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_CS_PIN,
809
-      #if MIXING_STEPPERS > 4
810
-        #undef _E4_PINS
811
-        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_CS_PIN,
812
-        #if MIXING_STEPPERS > 5
813
-          #undef _E5_PINS
814
-          #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, E5_MS1_PIN, E5_MS2_PIN, E5_CS_PIN,
815
-        #endif // MIXING_STEPPERS > 5
816
-      #endif // MIXING_STEPPERS > 4
817
-    #endif // MIXING_STEPPERS > 3
818
-  #endif // MIXING_STEPPERS > 2
819
-#endif // MIXING_STEPPERS > 1
820
-
821
-#define BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
822
-
823 734
 //
824 735
 // Assign endstop pins for boards with only 3 connectors
825 736
 //
@@ -856,7 +767,7 @@
856 767
 //
857 768
 // Disable unused endstop / probe pins
858 769
 //
859
-#if DISABLED(Z_MIN_PROBE_ENDSTOP)
770
+#if !HAS_BED_PROBE || DISABLED(Z_MIN_PROBE_ENDSTOP)
860 771
   #undef Z_MIN_PROBE_PIN
861 772
   #define Z_MIN_PROBE_PIN    -1
862 773
 #endif
@@ -904,14 +815,13 @@
904 815
   #define LCD_PINS_D7 -1
905 816
 #endif
906 817
 
907
-//
908
-// Dual X-carriage, Dual Y, Dual Z support
909
-//
910
-
911
-#define _X2_PINS
912
-#define _Y2_PINS
913
-#define _Z2_PINS
914
-#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
+ */
915 825
 
916 826
 #define __EPIN(p,q) E##p##_##q##_PIN
917 827
 #define _EPIN(p,q) __EPIN(p,q)
@@ -1019,26 +929,3 @@
1019 929
     #define Z3_MS3_PIN    _EPIN(Z3_E_INDEX, MS3)
1020 930
   #endif
1021 931
 #endif
1022
-
1023
-#ifndef HAL_SENSITIVE_PINS
1024
-  #define HAL_SENSITIVE_PINS
1025
-#endif
1026
-
1027
-#define SENSITIVE_PINS { \
1028
-    X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, X_MS1_PIN, X_MS2_PIN, X_CS_PIN, \
1029
-    Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Y_MS1_PIN, Y_MS2_PIN, Y_CS_PIN, \
1030
-    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, \
1031
-    PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \
1032
-    _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS BED_PINS \
1033
-    _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS \
1034
-    _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS \
1035
-    HAL_SENSITIVE_PINS \
1036
-  }
1037
-
1038
-#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
1039
-
1040
-// Note: default SPI pins are defined in the HAL
1041
-
1042
-#include HAL_PATH(../HAL, spi_pins.h)
1043
-
1044
-#endif // __PINS_H__

+ 516
- 0
Marlin/src/pins/sensitive_pins.h Bestand weergeven

@@ -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
+}

Laden…
Annuleren
Opslaan