瀏覽代碼

Overridable Options - Part 4 (PR#2556)

Apply `ENABLED` / `DISABLED` / `HAS_SERVOS` macros to pins files.
Scott Lahteine 8 年之前
父節點
當前提交
c0d7ea3e7e

+ 9
- 9
Marlin/pins.h 查看文件

@@ -175,7 +175,7 @@
175 175
   #endif
176 176
 #endif
177 177
 
178
-#ifdef DISABLE_MAX_ENDSTOPS
178
+#if ENABLED(DISABLE_MAX_ENDSTOPS)
179 179
   #undef X_MAX_PIN
180 180
   #undef Y_MAX_PIN
181 181
   #undef Z_MAX_PIN
@@ -184,7 +184,7 @@
184 184
   #define Z_MAX_PIN          -1
185 185
 #endif
186 186
 
187
-#ifdef DISABLE_MIN_ENDSTOPS
187
+#if ENABLED(DISABLE_MIN_ENDSTOPS)
188 188
   #undef X_MIN_PIN
189 189
   #undef Y_MIN_PIN
190 190
   #undef Z_MIN_PIN
@@ -193,36 +193,36 @@
193 193
   #define Z_MIN_PIN          -1
194 194
 #endif
195 195
 
196
-#if defined(DISABLE_Z_PROBE_ENDSTOP) || !defined(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
196
+#if ENABLED(DISABLE_Z_PROBE_ENDSTOP) || DISABLED(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
197 197
   #undef Z_PROBE_PIN
198 198
   #define Z_PROBE_PIN        -1
199 199
 #endif
200 200
 
201
-#ifdef DISABLE_XMAX_ENDSTOP
201
+#if ENABLED(DISABLE_XMAX_ENDSTOP)
202 202
   #undef X_MAX_PIN
203 203
   #define X_MAX_PIN          -1
204 204
 #endif
205 205
 
206
-#ifdef DISABLE_XMIN_ENDSTOP
206
+#if ENABLED(DISABLE_XMIN_ENDSTOP)
207 207
   #undef X_MIN_PIN 
208 208
   #define X_MIN_PIN          -1
209 209
 #endif
210 210
 
211
-#ifdef DISABLE_YMAX_ENDSTOP
211
+#if ENABLED(DISABLE_YMAX_ENDSTOP)
212 212
   #define Y_MAX_PIN          -1
213 213
 #endif
214 214
 
215
-#ifdef DISABLE_YMIN_ENDSTOP
215
+#if ENABLED(DISABLE_YMIN_ENDSTOP)
216 216
   #undef Y_MIN_PIN
217 217
   #define Y_MIN_PIN          -1
218 218
 #endif
219 219
 
220
-#ifdef DISABLE_ZMAX_ENDSTOP
220
+#if ENABLED(DISABLE_ZMAX_ENDSTOP)
221 221
   #undef Z_MAX_PIN
222 222
   #define Z_MAX_PIN          -1
223 223
 #endif
224 224
 
225
-#ifdef DISABLE_ZMIN_ENDSTOP
225
+#if ENABLED(DISABLE_ZMIN_ENDSTOP)
226 226
   #undef Z_MIN_PIN 
227 227
   #define Z_MIN_PIN          -1
228 228
 #endif

+ 1
- 1
Marlin/pins_3DRAG.h 查看文件

@@ -29,7 +29,7 @@
29 29
 
30 30
 #define HEATER_BED_PIN     9    // BED
31 31
 
32
-#if defined(ULTRA_LCD) && defined(NEWPANEL)
32
+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
33 33
   #undef BEEPER
34 34
   #define BEEPER -1
35 35
 

+ 1
- 1
Marlin/pins_5DPRINT.h 查看文件

@@ -52,7 +52,7 @@
52 52
 // The SDSS pin uses a different pin mapping from file Sd2PinMap.h
53 53
 #define SDSS               20
54 54
 
55
-#ifndef SDSUPPORT
55
+#if DISABLED(SDSUPPORT)
56 56
 // these pins are defined in the SD library if building with SD support
57 57
   #define SCK_PIN           9
58 58
   #define MISO_PIN         11

+ 7
- 3
Marlin/pins_AZTEEG_X3.h 查看文件

@@ -6,7 +6,8 @@
6 6
 
7 7
 //LCD Pins//
8 8
 
9
-#if defined(VIKI2) || defined(miniVIKI)
9
+#if ENABLED(VIKI2) || ENABLED(miniVIKI)
10
+
10 11
  #define BEEPER 33
11 12
  // Pins for DOGM SPI LCD Support
12 13
  #define DOGLCD_A0  31 
@@ -21,11 +22,14 @@
21 22
  #define SDSS 53
22 23
  #define SDCARDDETECT -1 // Pin 49 if using display sd interface   
23 24
  
24
-  #ifdef TEMP_STAT_LEDS
25
+  #if ENABLED(TEMP_STAT_LEDS)
25 26
    #define STAT_LED_RED 64
26 27
    #define STAT_LED_BLUE 63
27 28
   #endif
28
-#elif defined(TEMP_STAT_LEDS)
29
+
30
+#elif ENABLED(TEMP_STAT_LEDS)
31
+
29 32
   #define STAT_LED_RED       6
30 33
   #define STAT_LED_BLUE     11
34
+
31 35
 #endif

+ 5
- 5
Marlin/pins_AZTEEG_X3_PRO.h 查看文件

@@ -18,7 +18,7 @@
18 18
 //MIN endstops soldered onto the board. Delta code wants the homing endstops to be 
19 19
 //the MAX so I swapped them here.
20 20
 //
21
- #ifdef DELTA
21
+ #if ENABLED(DELTA)
22 22
   #undef X_MIN_PIN
23 23
   #undef X_MAX_PIN
24 24
   #undef Y_MIN_PIN
@@ -34,7 +34,7 @@
34 34
   #define Z_MAX_PIN        18
35 35
  #endif
36 36
 //
37
- #ifdef Z_PROBE_ENDSTOP
37
+ #if ENABLED(Z_PROBE_ENDSTOP)
38 38
 //#undef Z_MIN_PIN
39 39
 //#define Z_MIN_PIN        15
40 40
   #define Z_PROBE_PIN      19
@@ -81,7 +81,7 @@
81 81
  #undef SERVO2_PIN
82 82
  #undef SERVO3_PIN
83 83
 
84
- #ifdef NUM_SERVOS
84
+ #if HAS_SERVOS
85 85
    #define SERVO0_PIN       47
86 86
    #if NUM_SERVOS > 1
87 87
      #define SERVO1_PIN     -1
@@ -96,7 +96,7 @@
96 96
 
97 97
 //LCD Pins//
98 98
 
99
- #if defined(VIKI2) || defined(miniVIKI)
99
+ #if ENABLED(VIKI2) || ENABLED(miniVIKI)
100 100
   #define BEEPER           33
101 101
  // Pins for DOGM SPI LCD Support
102 102
   #define DOGLCD_A0        44
@@ -114,7 +114,7 @@
114 114
   #define KILL_PIN         31
115 115
  #endif
116 116
 
117
- #ifdef TEMP_STAT_LEDS
117
+ #if ENABLED(TEMP_STAT_LEDS)
118 118
   #define STAT_LED_RED     32
119 119
   #define STAT_LED_BLUE    35
120 120
  #endif

+ 1
- 1
Marlin/pins_BRAINWAVE.h 查看文件

@@ -50,7 +50,7 @@
50 50
 #define KILL_PIN           -1
51 51
 #define ALARM_PIN          -1
52 52
 
53
-#ifndef SDSUPPORT
53
+#if DISABLED(SDSUPPORT)
54 54
   // these pins are defined in the SD library if building with SD support
55 55
   #define SCK_PIN           9
56 56
   #define MISO_PIN         11

+ 1
- 1
Marlin/pins_BRAINWAVE_PRO.h 查看文件

@@ -56,7 +56,7 @@
56 56
 #define ALARM_PIN          -1
57 57
 #define SDCARDDETECT       12
58 58
 
59
-#ifndef SDSUPPORT
59
+#if DISABLED(SDSUPPORT)
60 60
 // these pins are defined in the SD library if building with SD support
61 61
   #define SCK_PIN          21
62 62
   #define MISO_PIN         23

+ 2
- 2
Marlin/pins_ELEFU_3.h 查看文件

@@ -61,7 +61,7 @@
61 61
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
62 62
 #define PHOTOGRAPH_PIN     29
63 63
 
64
-#ifdef RA_CONTROL_PANEL
64
+#if ENABLED(RA_CONTROL_PANEL)
65 65
 
66 66
   #define SDSS             53
67 67
   #define SDCARDDETECT     28
@@ -76,7 +76,7 @@
76 76
 
77 77
 #endif // RA_CONTROL_PANEL
78 78
 
79
-#ifdef RA_DISCO
79
+#if ENABLED(RA_DISCO)
80 80
   //variables for which pins the TLC5947 is using
81 81
   #define TLC_CLOCK_PIN    25
82 82
   #define TLC_BLANK_PIN    23

+ 1
- 1
Marlin/pins_FELIX2.h 查看文件

@@ -14,7 +14,7 @@
14 14
 
15 15
 #define PS_ON_PIN          12
16 16
 
17
-#if defined(ULTRA_LCD) && defined(NEWPANEL)
17
+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
18 18
 
19 19
   #define BLEN_C 2
20 20
   #define BLEN_B 1

+ 2
- 2
Marlin/pins_MEGATRONICS_3.h 查看文件

@@ -9,12 +9,12 @@
9 9
 #define LARGE_FLASH        true
10 10
 
11 11
 
12
-#ifdef Z_PROBE_SLED
12
+#if ENABLED(Z_PROBE_SLED)
13 13
   #define SLED_PIN         -1
14 14
 #endif
15 15
 
16 16
 // Servo support
17
-#ifdef NUM_SERVOS
17
+#if HAS_SERVOS
18 18
   #define SERVO0_PIN       46 //AUX3-6
19 19
   #if NUM_SERVOS > 1
20 20
     #define SERVO1_PIN     47 //AUX3-5

+ 5
- 5
Marlin/pins_MINIRAMBO.h 查看文件

@@ -53,10 +53,10 @@
53 53
 #define HEATER_1_PIN 7
54 54
 #define TEMP_1_PIN 1
55 55
 
56
-#ifdef BARICUDA
57
-#define HEATER_2_PIN 6
56
+#if ENABLED(BARICUDA)
57
+  #define HEATER_2_PIN 6
58 58
 #else
59
-#define HEATER_2_PIN -1
59
+  #define HEATER_2_PIN -1
60 60
 #endif
61 61
 
62 62
 #define TEMP_2_PIN -1
@@ -88,9 +88,9 @@
88 88
 #define KILL_PIN           -1 //80 with Smart Controller LCD
89 89
 #define SUICIDE_PIN        -1  //PIN that has to be turned on right after start, to keep power flowing.
90 90
 
91
-#ifdef ULTRA_LCD
91
+#if ENABLED(ULTRA_LCD)
92 92
   #define KILL_PIN 32
93
-  #ifdef NEWPANEL
93
+  #if ENABLED(NEWPANEL)
94 94
    //arduino pin which triggers an piezzo beeper
95 95
     #define BEEPER 84      // Beeper on AUX-4
96 96
     #define LCD_PINS_RS 82

+ 8
- 8
Marlin/pins_PRINTRBOARD.h 查看文件

@@ -9,7 +9,7 @@
9 9
   #error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
10 10
 #endif
11 11
 
12
-#ifdef AT90USBxx_TEENSYPP_ASSIGNMENTS  // use Teensyduino Teensy++2.0 pin assignments instead of Marlin traditional.
12
+#if ENABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS)  // use Teensyduino Teensy++2.0 pin assignments instead of Marlin traditional.
13 13
   #error These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h
14 14
 #endif
15 15
 
@@ -38,7 +38,7 @@
38 38
 
39 39
 // If soft or fast PWM is off then use Teensyduino pin numbering, Marlin
40 40
 // fastio pin numbering otherwise
41
-#ifdef FAN_SOFT_PWM || FAST_PWM_FAN
41
+#if ENABLED(FAN_SOFT_PWM) || ENABLED(FAST_PWM_FAN)
42 42
   #define FAN_PIN          22
43 43
 #else
44 44
   #define FAN_PIN          16
@@ -54,7 +54,7 @@
54 54
 #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
55 55
 #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
56 56
 
57
-#ifdef FILAMENT_SENSOR
57
+#if ENABLED(FILAMENT_SENSOR)
58 58
   #define FILWIDTH_PIN      2
59 59
 #endif
60 60
 
@@ -70,18 +70,18 @@
70 70
 #define KILL_PIN           -1
71 71
 #define ALARM_PIN          -1
72 72
 
73
-#ifndef SDSUPPORT
73
+#if DISABLED(SDSUPPORT)
74 74
   // these pins are defined in the SD library if building with SD support
75 75
   #define SCK_PIN           9
76 76
   #define MISO_PIN         11
77 77
   #define MOSI_PIN         10
78 78
 #endif
79 79
 
80
-#if defined(ULTRA_LCD) && defined(NEWPANEL)
80
+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
81 81
   //we have no buzzer installed
82 82
   #define BEEPER -1
83 83
   //LCD Pins
84
-  #ifdef LCD_I2C_PANELOLU2
84
+  #if ENABLED(LCD_I2C_PANELOLU2)
85 85
     #define BTN_EN1 27  //RX1 - fastio.h pin mapping 27
86 86
     #define BTN_EN2 26  //TX1 - fastio.h pin mapping 26
87 87
     #define BTN_ENC 43 //A3 - fastio.h pin mapping 43
@@ -91,7 +91,7 @@
91 91
   #define SDCARDDETECT -1    
92 92
 #endif // ULTRA_LCD && NEWPANEL
93 93
 
94
-#if defined(VIKI2) || defined(miniVIKI)
94
+#if ENABLED(VIKI2) || ENABLED(miniVIKI)
95 95
  #define BEEPER 32 //FastIO
96 96
  // Pins for DOGM SPI LCD Support
97 97
  #define DOGLCD_A0  42 //Non-FastIO
@@ -106,7 +106,7 @@
106 106
  #define SDSS 45
107 107
  #define SDCARDDETECT -1 // FastIO (Manual says 72 I'm not certain cause I can't test) 
108 108
 
109
- #ifdef TEMP_STAT_LEDS
109
+ #if ENABLED(TEMP_STAT_LEDS)
110 110
   #define STAT_LED_RED      12 //Non-FastIO
111 111
   #define STAT_LED_BLUE     10 //Non-FastIO
112 112
  #endif  

+ 8
- 8
Marlin/pins_RAMBO.h 查看文件

@@ -9,7 +9,7 @@
9 9
 #define LARGE_FLASH true
10 10
 
11 11
 // Servo support
12
-#ifdef NUM_SERVOS
12
+#if HAS_SERVOS
13 13
   #define SERVO0_PIN       22 //motor header MX1
14 14
   #if NUM_SERVOS > 1
15 15
     #define SERVO1_PIN     23 //Motor header MX2
@@ -22,7 +22,7 @@
22 22
   #endif
23 23
 #endif
24 24
 
25
-#ifdef Z_PROBE_SLED
25
+#if ENABLED(Z_PROBE_SLED)
26 26
   #define SLED_PIN         -1
27 27
 #endif
28 28
 
@@ -70,7 +70,7 @@
70 70
 #define HEATER_1_PIN 7
71 71
 #define TEMP_1_PIN 1
72 72
 
73
-#ifdef BARICUDA
73
+#if ENABLED(BARICUDA)
74 74
   #define HEATER_2_PIN 6
75 75
 #else
76 76
   #define HEATER_2_PIN -1
@@ -109,9 +109,9 @@
109 109
 #define KILL_PIN           -1 //80 with Smart Controller LCD
110 110
 #define SUICIDE_PIN        -1  //PIN that has to be turned on right after start, to keep power flowing.
111 111
 
112
-#ifdef ULTRA_LCD
112
+#if ENABLED(ULTRA_LCD)
113 113
   #define KILL_PIN 80
114
-  #ifdef NEWPANEL
114
+  #if ENABLED(NEWPANEL)
115 115
    //arduino pin which triggers an piezzo beeper
116 116
     #define BEEPER 79      // Beeper on AUX-4
117 117
     #define LCD_PINS_RS 70
@@ -164,7 +164,7 @@
164 164
 
165 165
 #endif // ULTRA_LCD
166 166
 
167
-#if defined(VIKI2) || defined(miniVIKI)
167
+#if ENABLED(VIKI2) || ENABLED(miniVIKI)
168 168
  #define BEEPER 44
169 169
  // Pins for DOGM SPI LCD Support
170 170
  #define DOGLCD_A0  70 
@@ -178,13 +178,13 @@
178 178
 
179 179
  #define SDCARDDETECT -1 // Pin 72 if using easy adapter board   
180 180
 
181
-  #ifdef TEMP_STAT_LEDS
181
+  #if ENABLED(TEMP_STAT_LEDS)
182 182
    #define STAT_LED_RED      22
183 183
    #define STAT_LED_BLUE     32 
184 184
   #endif
185 185
 #endif // VIKI2/miniVIKI
186 186
 
187
-#ifdef FILAMENT_SENSOR
187
+#if ENABLED(FILAMENT_SENSOR)
188 188
   //Filip added pin for Filament sensor analog input 
189 189
   #define FILWIDTH_PIN        3
190 190
 #endif

+ 20
- 21
Marlin/pins_RAMPS_13.h 查看文件

@@ -61,23 +61,23 @@
61 61
 #define SDSS               53
62 62
 #define LED_PIN            13
63 63
 
64
-#if MB(RAMPS_13_EEB) && defined(FILAMENT_SENSOR)  // FMM added for Filament Extruder
64
+#if MB(RAMPS_13_EEB) && ENABLED(FILAMENT_SENSOR)  // FMM added for Filament Extruder
65 65
   // define analog pin for the filament width sensor input
66 66
   // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
67 67
   #define FILWIDTH_PIN        5
68 68
 #endif
69 69
 
70
-#ifdef Z_PROBE_ENDSTOP
70
+#if ENABLED(Z_PROBE_ENDSTOP)
71 71
   // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
72 72
   #define Z_PROBE_PIN 32
73 73
 #endif
74 74
 
75
-#ifdef FILAMENT_RUNOUT_SENSOR
75
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
76 76
   // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
77 77
   #define FILRUNOUT_PIN        4
78 78
 #endif
79 79
 
80
-#if MB(RAMPS_13_EFF) || defined(IS_RAMPS_EFB)
80
+#if MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB)
81 81
   #define FAN_PIN            9 // (Sprinter config)
82 82
   #if MB(RAMPS_13_EFF)
83 83
     #define CONTROLLERFAN_PIN  -1 // Pin used for the fan to cool controller
@@ -90,7 +90,7 @@
90 90
 
91 91
 #define PS_ON_PIN          12
92 92
 
93
-#if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
93
+#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL)
94 94
   #define KILL_PIN           41
95 95
 #else
96 96
   #define KILL_PIN           -1
@@ -102,7 +102,7 @@
102 102
   #define HEATER_0_PIN       10   // EXTRUDER 1
103 103
 #endif
104 104
 
105
-#if MB(RAMPS_13_SF) || defined(IS_RAMPS_EFB)
105
+#if MB(RAMPS_13_SF) || ENABLED(IS_RAMPS_EFB)
106 106
   #define HEATER_1_PIN       -1
107 107
 #else
108 108
   #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
@@ -122,7 +122,7 @@
122 122
 
123 123
 #define TEMP_BED_PIN       14   // ANALOG NUMBERING
124 124
 
125
-#ifdef NUM_SERVOS
125
+#if HAS_SERVOS
126 126
   #define SERVO0_PIN         11
127 127
   #if NUM_SERVOS > 1
128 128
     #define SERVO1_PIN        6
@@ -135,15 +135,14 @@
135 135
   #endif
136 136
 #endif
137 137
 
138
-#ifdef Z_PROBE_SLED
138
+#if ENABLED(Z_PROBE_SLED)
139 139
   #define SLED_PIN         -1
140 140
 #endif
141 141
 
142
-#ifdef ULTRA_LCD
142
+#if ENABLED(ULTRA_LCD)
143 143
 
144
-  #ifdef NEWPANEL
145
-
146
-    #ifdef PANEL_ONE
144
+  #if ENABLED(NEWPANEL)
145
+    #if ENABLED(PANEL_ONE)
147 146
       #define LCD_PINS_RS 40
148 147
       #define LCD_PINS_ENABLE 42
149 148
       #define LCD_PINS_D4 65
@@ -159,7 +158,7 @@
159 158
       #define LCD_PINS_D7 29
160 159
     #endif
161 160
 
162
-    #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
161
+    #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
163 162
       #define BEEPER 37
164 163
 
165 164
       #define BTN_EN1 31
@@ -167,20 +166,20 @@
167 166
       #define BTN_ENC 35
168 167
 
169 168
       #define SDCARDDETECT 49
170
-    #elif defined(LCD_I2C_PANELOLU2)
169
+    #elif ENABLED(LCD_I2C_PANELOLU2)
171 170
       #define BTN_EN1 47  // reverse if the encoder turns the wrong way.
172 171
       #define BTN_EN2 43
173 172
       #define BTN_ENC 32
174 173
       #define LCD_SDSS 53
175 174
       #define SDCARDDETECT -1
176 175
       #define KILL_PIN 41
177
-    #elif defined(LCD_I2C_VIKI)
176
+    #elif ENABLED(LCD_I2C_VIKI)
178 177
       #define BTN_EN1 22  // reverse if the encoder turns the wrong way.
179 178
       #define BTN_EN2 7
180 179
       #define BTN_ENC -1
181 180
       #define LCD_SDSS 53
182 181
       #define SDCARDDETECT 49
183
-    #elif defined(ELB_FULL_GRAPHIC_CONTROLLER)
182
+    #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
184 183
       #define BTN_EN1 35  // reverse if the encoder turns the wrong way.
185 184
       #define BTN_EN2 37
186 185
       #define BTN_ENC 31
@@ -217,14 +216,14 @@
217 216
       #define BEEPER 33  // Beeper on AUX-4
218 217
 
219 218
       // buttons are directly attached using AUX-2
220
-      #ifdef REPRAPWORLD_KEYPAD
219
+      #if ENABLED(REPRAPWORLD_KEYPAD)
221 220
         #define BTN_EN1 64 // encoder
222 221
         #define BTN_EN2 59 // encoder
223 222
         #define BTN_ENC 63 // enter button
224 223
         #define SHIFT_OUT 40 // shift register
225 224
         #define SHIFT_CLK 44 // shift register
226 225
         #define SHIFT_LD 42 // shift register
227
-      #elif defined(PANEL_ONE)
226
+      #elif ENABLED(PANEL_ONE)
228 227
         #define BTN_EN1 59 // AUX2 PIN 3
229 228
         #define BTN_EN2 63 // AUX2 PIN 4
230 229
         #define BTN_ENC 49 // AUX3 PIN 7
@@ -234,7 +233,7 @@
234 233
         #define BTN_ENC 31  // the click
235 234
       #endif
236 235
 
237
-      #ifdef G3D_PANEL
236
+      #if ENABLED(G3D_PANEL)
238 237
         #define SDCARDDETECT 49
239 238
       #else
240 239
         #define SDCARDDETECT -1  // Ramps does not use this port
@@ -264,13 +263,13 @@
264 263
 #endif // ULTRA_LCD
265 264
 
266 265
 // SPI for Max6675 Thermocouple
267
-#ifndef SDSUPPORT
266
+#if DISABLED(SDSUPPORT)
268 267
   #define MAX6675_SS       66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
269 268
 #else
270 269
   #define MAX6675_SS       66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
271 270
 #endif
272 271
 
273
-#ifndef SDSUPPORT
272
+#if DISABLED(SDSUPPORT)
274 273
   // these pins are defined in the SD library if building with SD support
275 274
   #define SCK_PIN          52
276 275
   #define MISO_PIN         50

+ 3
- 3
Marlin/pins_RAMPS_OLD.h 查看文件

@@ -37,7 +37,7 @@
37 37
 #define PS_ON_PIN          -1
38 38
 #define KILL_PIN           -1
39 39
 
40
-#ifdef RAMPS_V_1_0 // RAMPS_V_1_0
40
+#if ENABLED(RAMPS_V_1_0) // RAMPS_V_1_0
41 41
   #define HEATER_0_PIN     12    // RAMPS 1.0
42 42
   #define HEATER_BED_PIN   -1    // RAMPS 1.0
43 43
   #define FAN_PIN          11    // RAMPS 1.0
@@ -55,13 +55,13 @@
55 55
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
56 56
 
57 57
 // SPI for Max6675 Thermocouple
58
-#ifndef SDSUPPORT
58
+#if DISABLED(SDSUPPORT)
59 59
   #define MAX6675_SS       66// Do not use pin 53 if there is even the remote possibility of using Display/SD card
60 60
 #else
61 61
   #define MAX6675_SS       66// Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
62 62
 #endif
63 63
 
64
-#ifndef SDSUPPORT
64
+#if DISABLED(SDSUPPORT)
65 65
   // these pins are defined in the SD library if building with SD support
66 66
   #define SCK_PIN          52
67 67
   #define MISO_PIN         50

+ 2
- 2
Marlin/pins_RIGIDBOARD.h 查看文件

@@ -4,7 +4,7 @@
4 4
 
5 5
 #include "pins_RAMPS_13.h"
6 6
 
7
-#ifdef Z_PROBE_ENDSTOP
7
+#if ENABLED(Z_PROBE_ENDSTOP)
8 8
   #define Z_PROBE_PIN      19
9 9
 #endif
10 10
 
@@ -20,7 +20,7 @@
20 20
 
21 21
 // LCD Panel options for the RigidBoard
22 22
 
23
-#ifdef RIGIDBOT_PANEL
23
+#if ENABLED(RIGIDBOT_PANEL)
24 24
 
25 25
   #undef BEEPER
26 26
   #define BEEPER -1

+ 10
- 9
Marlin/pins_SANGUINOLOLU_11.h 查看文件

@@ -33,11 +33,11 @@
33 33
   #endif
34 34
 #endif
35 35
 
36
-#ifdef Z_PROBE_SLED
36
+#if ENABLED(Z_PROBE_SLED)
37 37
   #define SLED_PIN         -1
38 38
 #endif
39 39
 
40
-#ifdef NUM_SERVOS
40
+#if HAS_SERVOS
41 41
   #define SERVO0_PIN       -1
42 42
   #if NUM_SERVOS > 1
43 43
     #define SERVO1_PIN     -1
@@ -57,7 +57,7 @@
57 57
 #define HEATER_1_PIN       -1
58 58
 #define HEATER_2_PIN       -1
59 59
 
60
-#ifdef SANGUINOLOLU_V_1_2
60
+#if ENABLED(SANGUINOLOLU_V_1_2)
61 61
 
62 62
   #define HEATER_BED_PIN   12 // (bed)
63 63
   #define X_ENABLE_PIN     14
@@ -65,7 +65,7 @@
65 65
   #define Z_ENABLE_PIN     26
66 66
   #define E0_ENABLE_PIN    14
67 67
 
68
-  #ifdef LCD_I2C_PANELOLU2
68
+  #if ENABLED(LCD_I2C_PANELOLU2)
69 69
     #define FAN_PIN         4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
70 70
   #endif
71 71
 
@@ -92,15 +92,15 @@
92 92
  */
93 93
 //#define SDSS               24
94 94
 
95
-#if defined(ULTRA_LCD) && defined(NEWPANEL)
95
+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
96 96
 
97 97
   // No buzzer installed
98 98
   #define BEEPER -1
99 99
 
100 100
   // LCD Pins
101
-  #ifdef DOGLCD
101
+  #if ENABLED(DOGLCD)
102 102
 
103
-    #ifdef U8GLIB_ST7920 //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
103
+    #if ENABLED(U8GLIB_ST7920) //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
104 104
 
105 105
       #if MB(MELZI) // Melzi board
106 106
         #define LCD_PINS_RS     30 //CS chip select /SS chip slave select
@@ -144,7 +144,7 @@
144 144
   //The encoder and click button
145 145
   #define BTN_EN1               11
146 146
   #define BTN_EN2               10
147
-  #ifdef LCD_I2C_PANELOLU2
147
+  #if ENABLED(LCD_I2C_PANELOLU2)
148 148
     #if MB(MELZI)
149 149
       #define BTN_ENC           29
150 150
       #define LCD_SDSS          30 // Panelolu2 SD card reader rather than the Melzi
@@ -158,9 +158,10 @@
158 158
 
159 159
   #define SDCARDDETECT          -1
160 160
 
161
-#elif defined(MAKRPANEL)
161
+#elif ENABLED(MAKRPANEL)
162 162
 
163 163
   #define BEEPER                29
164
+
164 165
   // Pins for DOGM SPI LCD Support
165 166
   #define DOGLCD_A0             30
166 167
   #define DOGLCD_CS             17

+ 4
- 4
Marlin/pins_SAV_MKI.h 查看文件

@@ -45,7 +45,7 @@
45 45
 #define TEMP_1_PIN         -1
46 46
 #define TEMP_2_PIN         -1
47 47
 
48
-#ifndef SDSUPPORT
48
+#if DISABLED(SDSUPPORT)
49 49
    // these pins are defined in the SD library if building with SD support
50 50
   #define SCK_PIN          9
51 51
   #define MISO_PIN         11
@@ -93,13 +93,13 @@
93 93
 #define LCD_PINS_D6        -1
94 94
 #define LCD_PINS_D7        -1
95 95
 
96
-#ifdef SAV_3DLCD
96
+#if ENABLED(SAV_3DLCD)
97 97
   // For LCD SHIFT register LCD
98 98
   #define SR_DATA_PIN         EXT_AUX_SDA_D1
99 99
   #define SR_CLK_PIN          EXT_AUX_SCL_D0
100 100
 #endif  // SAV_3DLCD
101 101
 
102
-#if defined(SAV_3DLCD)||defined(SAV_3DGLCD)
102
+#if ENABLED(SAV_3DLCD) || ENABLED(SAV_3DGLCD)
103 103
   #define BTN_EN1            EXT_AUX_A1_IO
104 104
   #define BTN_EN2            EXT_AUX_A0_IO
105 105
   #define BTN_ENC            EXT_AUX_PWM_D24
@@ -108,6 +108,6 @@
108 108
   #define HOME_PIN           EXT_AUX_A4_IO
109 109
 #endif // SAV_3DLCD || SAV_3DGLCD
110 110
 
111
-#ifdef NUM_SERVOS
111
+#if HAS_SERVOS
112 112
   #define SERVO0_PIN       41 // In teensy's pin definition for pinMode (in servo.cpp)
113 113
 #endif

+ 2
- 2
Marlin/pins_TEENSY2.h 查看文件

@@ -93,14 +93,14 @@
93 93
 #define KILL_PIN           -1
94 94
 #define ALARM_PIN          -1
95 95
 
96
-#ifndef SDSUPPORT
96
+#if DISABLED(SDSUPPORT)
97 97
 // these pins are defined in the SD library if building with SD support
98 98
   #define SCK_PIN         21 // 9
99 99
   #define MISO_PIN        23 // 11
100 100
   #define MOSI_PIN        22 // 10
101 101
 #endif
102 102
 
103
-#ifdef ULTIPANEL
103
+#if ENABLED(ULTIPANEL)
104 104
   #define LCD_PINS_RS         8
105 105
   #define LCD_PINS_ENABLE     9
106 106
   #define LCD_PINS_D4        10

+ 5
- 5
Marlin/pins_TEENSYLU.h 查看文件

@@ -9,7 +9,7 @@
9 9
   #error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
10 10
 #endif
11 11
 
12
-#ifdef AT90USBxx_TEENSYPP_ASSIGNMENTS  // use Teensyduino Teensy++2.0 pin assignments instead of Marlin traditional.
12
+#if ENABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS)  // use Teensyduino Teensy++2.0 pin assignments instead of Marlin traditional.
13 13
   #error These Teensylu assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h
14 14
 #endif
15 15
 
@@ -38,7 +38,7 @@
38 38
 
39 39
 // If soft or fast PWM is off then use Teensyduino pin numbering, Marlin
40 40
 // fastio pin numbering otherwise
41
-#ifdef FAN_SOFT_PWM || FAST_PWM_FAN
41
+#if ENABLED(FAN_SOFT_PWM) || ENABLED(FAST_PWM_FAN)
42 42
   #define FAN_PIN          22
43 43
 #else
44 44
   #define FAN_PIN          16
@@ -60,18 +60,18 @@
60 60
 #define KILL_PIN           -1
61 61
 #define ALARM_PIN          -1
62 62
 
63
-#ifndef SDSUPPORT
63
+#if DISABLED(SDSUPPORT)
64 64
 // these pins are defined in the SD library if building with SD support
65 65
   #define SCK_PIN           9
66 66
   #define MISO_PIN         11
67 67
   #define MOSI_PIN         10
68 68
 #endif
69 69
 
70
-#if defined(ULTRA_LCD) && defined(NEWPANEL)
70
+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
71 71
   //we have no buzzer installed
72 72
   #define BEEPER -1
73 73
   //LCD Pins
74
-  #ifdef LCD_I2C_PANELOLU2
74
+  #if ENABLED(LCD_I2C_PANELOLU2)
75 75
     #define BTN_EN1 27  //RX1 - fastio.h pin mapping 27
76 76
     #define BTN_EN2 26  //TX1 - fastio.h pin mapping 26
77 77
     #define BTN_ENC 43 //A3 - fastio.h pin mapping 43

+ 2
- 2
Marlin/pins_ULTIMAKER.h 查看文件

@@ -55,9 +55,9 @@
55 55
 #define SUICIDE_PIN        54  //PIN that has to be turned on right after start, to keep power flowing.
56 56
 #define SERVO0_PIN         13  // untested
57 57
 
58
-#ifdef ULTRA_LCD
58
+#if ENABLED(ULTRA_LCD)
59 59
 
60
-  #ifdef NEWPANEL
60
+  #if ENABLED(NEWPANEL)
61 61
   //arduino pin witch triggers an piezzo beeper
62 62
     #define BEEPER 18
63 63
 

Loading…
取消
儲存