Browse Source

Apply overridables to Configuration files

Scott Lahteine 9 years ago
parent
commit
37d1879386
31 changed files with 604 additions and 603 deletions
  1. 41
    40
      Marlin/Conditionals.h
  2. 15
    15
      Marlin/Configuration.h
  3. 22
    22
      Marlin/Configuration_adv.h
  4. 36
    36
      Marlin/SanityCheck.h
  5. 14
    14
      Marlin/example_configurations/Felix/Configuration.h
  6. 12
    12
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  7. 22
    22
      Marlin/example_configurations/Felix/Configuration_adv.h
  8. 14
    14
      Marlin/example_configurations/Hephestos/Configuration.h
  9. 22
    22
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  10. 14
    14
      Marlin/example_configurations/K8200/Configuration.h
  11. 22
    22
      Marlin/example_configurations/K8200/Configuration_adv.h
  12. 14
    14
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  13. 14
    14
      Marlin/example_configurations/RigidBot/Configuration.h
  14. 22
    22
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  15. 14
    14
      Marlin/example_configurations/SCARA/Configuration.h
  16. 22
    22
      Marlin/example_configurations/SCARA/Configuration_adv.h
  17. 14
    14
      Marlin/example_configurations/WITBOX/Configuration.h
  18. 22
    22
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  19. 14
    14
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  20. 16
    16
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  21. 22
    22
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  22. 16
    16
      Marlin/example_configurations/delta/generic/Configuration.h
  23. 22
    22
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  24. 16
    16
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  25. 22
    22
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  26. 16
    16
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  27. 32
    32
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  28. 14
    14
      Marlin/example_configurations/makibox/Configuration.h
  29. 22
    22
      Marlin/example_configurations/makibox/Configuration_adv.h
  30. 14
    14
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  31. 22
    22
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

+ 41
- 40
Marlin/Conditionals.h View File

@@ -14,7 +14,7 @@
14 14
 
15 15
   #define CONFIGURATION_LCD
16 16
 
17
-  #if defined(MAKRPANEL)
17
+  #if ENABLED(MAKRPANEL)
18 18
     #define DOGLCD
19 19
     #define SDSUPPORT
20 20
     #define DEFAULT_LCD_CONTRAST 17
@@ -22,16 +22,16 @@
22 22
     #define NEWPANEL
23 23
   #endif
24 24
 
25
-  #if defined(miniVIKI) || defined(VIKI2) || defined(ELB_FULL_GRAPHIC_CONTROLLER)
25
+  #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
26 26
     #define ULTRA_LCD  //general LCD support, also 16x2
27 27
     #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
28 28
     #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
29 29
 
30
-    #ifdef miniVIKI
30
+    #if ENABLED(miniVIKI)
31 31
       #define DEFAULT_LCD_CONTRAST 95
32
-    #elif defined(VIKI2)
32
+    #elif ENABLED(VIKI2)
33 33
       #define DEFAULT_LCD_CONTRAST 40
34
-    #elif defined(ELB_FULL_GRAPHIC_CONTROLLER)
34
+    #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
35 35
       #define DEFAULT_LCD_CONTRAST 110
36 36
       #define U8GLIB_LM6059_AF
37 37
     #endif
@@ -41,34 +41,34 @@
41 41
   #endif
42 42
 
43 43
   // Generic support for SSD1306 OLED based LCDs.
44
-  #if defined(U8GLIB_SSD1306)
44
+  #if ENABLED(U8GLIB_SSD1306)
45 45
     #define ULTRA_LCD  //general LCD support, also 16x2
46 46
     #define DOGLCD  // Support for I2C LCD 128x64 (Controller SSD1306 graphic Display Family)
47 47
   #endif
48 48
 
49 49
 
50
-  #ifdef PANEL_ONE
50
+  #if ENABLED(PANEL_ONE)
51 51
     #define SDSUPPORT
52 52
     #define ULTIMAKERCONTROLLER
53 53
   #endif
54 54
 
55
-  #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
55
+  #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
56 56
     #define DOGLCD
57 57
     #define U8GLIB_ST7920
58 58
     #define REPRAP_DISCOUNT_SMART_CONTROLLER
59 59
   #endif
60 60
 
61
-  #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL) || defined(RIGIDBOT_PANEL)
61
+  #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL)
62 62
     #define ULTIPANEL
63 63
     #define NEWPANEL
64 64
   #endif
65 65
 
66
-  #ifdef REPRAPWORLD_KEYPAD
66
+  #if ENABLED(REPRAPWORLD_KEYPAD)
67 67
     #define ULTIPANEL
68 68
     #define NEWPANEL
69 69
   #endif
70 70
 
71
-  #ifdef RA_CONTROL_PANEL
71
+  #if ENABLED(RA_CONTROL_PANEL)
72 72
     #define LCD_I2C_TYPE_PCA8574
73 73
     #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
74 74
     #define ULTIPANEL
@@ -87,7 +87,7 @@
87 87
    * I2C PANELS
88 88
    */
89 89
 
90
-  #ifdef LCD_I2C_SAINSMART_YWROBOT
90
+  #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
91 91
     // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
92 92
     // Make sure it is placed in the Arduino libraries directory.
93 93
     #define LCD_I2C_TYPE_PCF8575
@@ -97,7 +97,7 @@
97 97
   #endif
98 98
 
99 99
   // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
100
-  #ifdef LCD_I2C_PANELOLU2
100
+  #if ENABLED(LCD_I2C_PANELOLU2)
101 101
     #define LCD_I2C_TYPE_MCP23017
102 102
     #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
103 103
     #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
@@ -110,7 +110,7 @@
110 110
       #define ENCODER_STEPS_PER_MENU_ITEM 1
111 111
     #endif
112 112
 
113
-    #ifdef LCD_USE_I2C_BUZZER
113
+    #if ENABLED(LCD_USE_I2C_BUZZER)
114 114
       #define LCD_FEEDBACK_FREQUENCY_HZ 1000
115 115
       #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
116 116
     #endif
@@ -120,7 +120,7 @@
120 120
   #endif
121 121
 
122 122
   // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
123
-  #ifdef LCD_I2C_VIKI
123
+  #if ENABLED(LCD_I2C_VIKI)
124 124
     // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
125 125
     // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
126 126
     // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
@@ -137,17 +137,17 @@
137 137
   // 2 wire Non-latching LCD SR from:
138 138
   // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
139 139
 
140
-  #ifdef SAV_3DLCD
140
+  #if ENABLED(SAV_3DLCD)
141 141
      #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
142 142
      #define ULTIPANEL
143 143
      #define NEWPANEL
144 144
   #endif
145 145
 
146
-  #ifdef ULTIPANEL
146
+  #if ENABLED(ULTIPANEL)
147 147
     #define NEWPANEL  //enable this if you have a click-encoder panel
148 148
     #define SDSUPPORT
149 149
     #define ULTRA_LCD
150
-    #ifdef DOGLCD // Change number of lines to match the DOG graphic display
150
+    #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
151 151
       #define LCD_WIDTH 22
152 152
       #define LCD_HEIGHT 5
153 153
     #else
@@ -155,8 +155,8 @@
155 155
       #define LCD_HEIGHT 4
156 156
     #endif
157 157
   #else //no panel but just LCD
158
-    #ifdef ULTRA_LCD
159
-      #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
158
+    #if ENABLED(ULTRA_LCD)
159
+      #if ENABLED(DOGLCD) // Change number of lines to match the 128x64 graphics display
160 160
         #define LCD_WIDTH 22
161 161
         #define LCD_HEIGHT 5
162 162
       #else
@@ -166,7 +166,7 @@
166 166
     #endif
167 167
   #endif
168 168
 
169
-  #ifdef DOGLCD
169
+  #if ENABLED(DOGLCD)
170 170
     /* Custom characters defined in font font_6x10_marlin_symbols */
171 171
     // \x00 intentionally skipped to avoid problems in strings
172 172
     #define LCD_STR_REFRESH     "\x01"
@@ -198,16 +198,16 @@
198 198
   /**
199 199
    * Default LCD contrast for dogm-like LCD displays
200 200
    */
201
-  #if defined(DOGLCD) && !defined(DEFAULT_LCD_CONTRAST)
201
+  #if ENABLED(DOGLCD) && DISABLED(DEFAULT_LCD_CONTRAST)
202 202
     #define DEFAULT_LCD_CONTRAST 32
203 203
   #endif
204 204
 
205
-  #ifdef DOGLCD
205
+  #if ENABLED(DOGLCD)
206 206
     #define HAS_LCD_CONTRAST
207
-    #ifdef U8GLIB_ST7920
207
+    #if ENABLED(U8GLIB_ST7920)
208 208
       #undef HAS_LCD_CONTRAST
209 209
     #endif
210
-    #ifdef U8GLIB_SSD1306
210
+    #if ENABLED(U8GLIB_SSD1306)
211 211
       #undef HAS_LCD_CONTRAST
212 212
     #endif  
213 213
   #endif
@@ -227,18 +227,18 @@
227 227
   /**
228 228
    * ENDSTOPPULLUPS
229 229
    */
230
-  #ifdef ENDSTOPPULLUPS
231
-    #ifndef DISABLE_MAX_ENDSTOPS
230
+  #if ENABLED(ENDSTOPPULLUPS)
231
+    #if DISABLED(DISABLE_MAX_ENDSTOPS)
232 232
       #define ENDSTOPPULLUP_XMAX
233 233
       #define ENDSTOPPULLUP_YMAX
234 234
       #define ENDSTOPPULLUP_ZMAX
235 235
     #endif
236
-    #ifndef DISABLE_MIN_ENDSTOPS
236
+    #if DISABLED(DISABLE_MIN_ENDSTOPS)
237 237
       #define ENDSTOPPULLUP_XMIN
238 238
       #define ENDSTOPPULLUP_YMIN
239 239
       #define ENDSTOPPULLUP_ZMIN
240 240
     #endif
241
-    #ifndef DISABLE_Z_PROBE_ENDSTOP
241
+    #if DISABLED(DISABLE_Z_PROBE_ENDSTOP)
242 242
       #define ENDSTOPPULLUP_ZPROBE
243 243
     #endif
244 244
   #endif
@@ -253,7 +253,7 @@
253 253
   /**
254 254
    * SCARA
255 255
    */
256
-  #ifdef SCARA
256
+  #if ENABLED(SCARA)
257 257
     #undef SLOWDOWN
258 258
     #define QUICK_HOME //SCARA needs Quickhome
259 259
   #endif
@@ -261,12 +261,12 @@
261 261
   /**
262 262
    * AUTOSET LOCATIONS OF LIMIT SWITCHES
263 263
    */
264
-  #ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
264
+  #if ENABLED(MANUAL_HOME_POSITIONS)  // Use manual limit switch locations
265 265
     #define X_HOME_POS MANUAL_X_HOME_POS
266 266
     #define Y_HOME_POS MANUAL_Y_HOME_POS
267 267
     #define Z_HOME_POS MANUAL_Z_HOME_POS
268 268
   #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
269
-    #ifdef BED_CENTER_AT_0_0
269
+    #if ENABLED(BED_CENTER_AT_0_0)
270 270
       #define X_HOME_POS X_MAX_LENGTH * X_HOME_DIR * 0.5
271 271
       #define Y_HOME_POS Y_MAX_LENGTH * Y_HOME_DIR * 0.5
272 272
     #else
@@ -279,7 +279,7 @@
279 279
   /**
280 280
    * Auto Bed Leveling
281 281
    */
282
-  #ifdef ENABLE_AUTO_BED_LEVELING
282
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
283 283
     // Boundaries for probing based on set limits
284 284
     #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
285 285
     #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
@@ -292,14 +292,14 @@
292 292
    /**
293 293
     * Sled Options
294 294
     */ 
295
-  #ifdef Z_PROBE_SLED
295
+  #if ENABLED(Z_PROBE_SLED)
296 296
     #define Z_SAFE_HOMING
297 297
   #endif
298 298
   
299 299
   /**
300 300
    * MAX_STEP_FREQUENCY differs for TOSHIBA
301 301
    */
302
-  #ifdef CONFIG_STEPPERS_TOSHIBA
302
+  #if ENABLED(CONFIG_STEPPERS_TOSHIBA)
303 303
     #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
304 304
   #else
305 305
     #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
@@ -315,12 +315,12 @@
315 315
   /**
316 316
    * Advance calculated values
317 317
    */
318
-  #ifdef ADVANCE
318
+  #if ENABLED(ADVANCE)
319 319
     #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI)
320 320
     #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA)
321 321
   #endif
322 322
 
323
-  #if defined(ULTIPANEL) && !defined(ELB_FULL_GRAPHIC_CONTROLLER)
323
+  #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
324 324
     #undef SDCARDDETECTINVERTED
325 325
   #endif
326 326
 
@@ -428,11 +428,12 @@
428 428
   #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
429 429
   #define HAS_FAN (PIN_EXISTS(FAN))
430 430
   #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
431
+  #define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0)
431 432
   #define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
432 433
   #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
433 434
   #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
434 435
   #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
435
-  #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
436
+  #define HAS_FILAMENT_SENSOR (ENABLED(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
436 437
   #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT))
437 438
   #define HAS_HOME (PIN_EXISTS(HOME))
438 439
   #define HAS_KILL (PIN_EXISTS(KILL))
@@ -490,7 +491,7 @@
490 491
    * Helper Macros for heaters and extruder fan
491 492
    */
492 493
   #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
493
-  #if EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
494
+  #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL)
494 495
     #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
495 496
     #if EXTRUDERS > 2
496 497
       #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
@@ -499,7 +500,7 @@
499 500
       #endif
500 501
     #endif
501 502
   #endif
502
-  #ifdef HEATERS_PARALLEL
503
+  #if ENABLED(HEATERS_PARALLEL)
503 504
     #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
504 505
   #else
505 506
     #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)

+ 15
- 15
Marlin/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated:
248 248
 
249 249
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
250 250
 
251
-#ifdef PIDTEMPBED
251
+#if ENABLED(PIDTEMPBED)
252 252
 
253 253
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
254 254
 
@@ -318,7 +318,7 @@ Here are some standard links for getting your machine calibrated:
318 318
 // coarse Endstop Settings
319 319
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
320 320
 
321
-#ifndef ENDSTOPPULLUPS
321
+#if DISABLED(ENDSTOPPULLUPS)
322 322
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
323 323
   // #define ENDSTOPPULLUP_XMAX
324 324
   // #define ENDSTOPPULLUP_YMAX
@@ -408,7 +408,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
408 408
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
409 409
                                  // It is assumed that when logic high = filament available
410 410
                                  //                    when logic  low = filament ran out
411
-#ifdef FILAMENT_RUNOUT_SENSOR
411
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
412 412
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
413 413
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
414 414
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -421,11 +421,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
421 421
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
422 422
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
423 423
 
424
-#ifdef MANUAL_BED_LEVELING
424
+#if ENABLED(MANUAL_BED_LEVELING)
425 425
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
426 426
 #endif  // MANUAL_BED_LEVELING
427 427
 
428
-#ifdef MESH_BED_LEVELING
428
+#if ENABLED(MESH_BED_LEVELING)
429 429
   #define MESH_MIN_X 10
430 430
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
431 431
   #define MESH_MIN_Y 10
@@ -444,7 +444,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
444 444
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
445 445
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
446 446
 
447
-#ifdef ENABLE_AUTO_BED_LEVELING
447
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
448 448
 
449 449
   // There are 2 different ways to specify probing locations
450 450
   //
@@ -461,7 +461,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
461 461
   // Note: this feature generates 10KB extra code size
462 462
   #define AUTO_BED_LEVELING_GRID
463 463
 
464
-  #ifdef AUTO_BED_LEVELING_GRID
464
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
465 465
 
466 466
     #define LEFT_PROBE_BED_POSITION 15
467 467
     #define RIGHT_PROBE_BED_POSITION 170
@@ -518,7 +518,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
518 518
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
519 519
                           // - Block Z homing only when the probe is outside bed area.
520 520
 
521
-  #ifdef Z_SAFE_HOMING
521
+  #if ENABLED(Z_SAFE_HOMING)
522 522
 
523 523
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
524 524
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -550,7 +550,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
550 550
 
551 551
 // Manual homing switch locations:
552 552
 // For deltabots this means top and center of the Cartesian print volume.
553
-#ifdef MANUAL_HOME_POSITIONS
553
+#if ENABLED(MANUAL_HOME_POSITIONS)
554 554
   #define MANUAL_X_HOME_POS 0
555 555
   #define MANUAL_Y_HOME_POS 0
556 556
   #define MANUAL_Z_HOME_POS 0
@@ -589,8 +589,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
589 589
 
590 590
 // Custom M code points
591 591
 #define CUSTOM_M_CODES
592
-#ifdef CUSTOM_M_CODES
593
-  #ifdef ENABLE_AUTO_BED_LEVELING
592
+#if ENABLED(CUSTOM_M_CODES)
593
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
594 594
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
595 595
     #define Z_PROBE_OFFSET_RANGE_MIN -20
596 596
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -607,7 +607,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
607 607
 //define this to enable EEPROM support
608 608
 //#define EEPROM_SETTINGS
609 609
 
610
-#ifdef EEPROM_SETTINGS
610
+#if ENABLED(EEPROM_SETTINGS)
611 611
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
612 612
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
613 613
 #endif
@@ -796,7 +796,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
796 796
 // With this option servos are powered only during movement, then turned off to prevent jitter.
797 797
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
798 798
 
799
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
799
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
800 800
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
801 801
   // 300ms is a good value but you can try less delay.
802 802
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,16 +31,16 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
38 38
 
39
-#ifdef PIDTEMP
39
+#if ENABLED(PIDTEMP)
40 40
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
41 41
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
42 42
   #define PID_ADD_EXTRUSION_RATE
43
-  #ifdef PID_ADD_EXTRUSION_RATE
43
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
44 44
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
45 45
   #endif
46 46
 #endif
@@ -56,7 +56,7 @@
56 56
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
57 57
  */
58 58
 #define AUTOTEMP
59
-#ifdef AUTOTEMP
59
+#if ENABLED(AUTOTEMP)
60 60
   #define AUTOTEMP_OLDWEIGHT 0.98
61 61
 #endif
62 62
 
@@ -133,7 +133,7 @@
133 133
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
134 134
 //#define Z_DUAL_STEPPER_DRIVERS
135 135
 
136
-#ifdef Z_DUAL_STEPPER_DRIVERS
136
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
137 137
 
138 138
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
139 139
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -150,7 +150,7 @@
150 150
 
151 151
   // #define Z_DUAL_ENDSTOPS
152 152
 
153
-  #ifdef Z_DUAL_ENDSTOPS
153
+  #if ENABLED(Z_DUAL_ENDSTOPS)
154 154
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
155 155
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
156 156
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -169,7 +169,7 @@
169 169
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
170 170
 // allowing faster printing speeds.
171 171
 //#define DUAL_X_CARRIAGE
172
-#ifdef DUAL_X_CARRIAGE
172
+#if ENABLED(DUAL_X_CARRIAGE)
173 173
   // Configuration for second X-carriage
174 174
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
175 175
   // the second x-carriage always homes to the maximum endstop.
@@ -240,7 +240,7 @@
240 240
 
241 241
 // @section lcd
242 242
 
243
-#ifdef ULTIPANEL
243
+#if ENABLED(ULTIPANEL)
244 244
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
245 245
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 246
 #endif
@@ -289,7 +289,7 @@
289 289
 
290 290
 // @section lcd
291 291
 
292
-#ifdef SDSUPPORT
292
+#if ENABLED(SDSUPPORT)
293 293
 
294 294
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
295 295
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -310,7 +310,7 @@
310 310
   // Show a progress bar on HD44780 LCDs for SD printing
311 311
   //#define LCD_PROGRESS_BAR
312 312
 
313
-  #ifdef LCD_PROGRESS_BAR
313
+  #if ENABLED(LCD_PROGRESS_BAR)
314 314
     // Amount of time (ms) to show the bar
315 315
     #define PROGRESS_BAR_BAR_TIME 2000
316 316
     // Amount of time (ms) to show the status message
@@ -333,7 +333,7 @@
333 333
 #endif // SDSUPPORT
334 334
 
335 335
 // for dogm lcd displays you can choose some additional fonts:
336
-#ifdef DOGLCD
336
+#if ENABLED(DOGLCD)
337 337
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
338 338
   // we don't have a big font for Cyrillic, Kana
339 339
   //#define USE_BIG_EDIT_FONT
@@ -348,7 +348,7 @@
348 348
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
349 349
 //#define USE_WATCHDOG
350 350
 
351
-#ifdef USE_WATCHDOG
351
+#if ENABLED(USE_WATCHDOG)
352 352
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
353 353
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
354 354
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -361,7 +361,7 @@
361 361
 // it can e.g. be used to change z-positions in the print startup phase in real-time
362 362
 // does not respect endstops!
363 363
 //#define BABYSTEPPING
364
-#ifdef BABYSTEPPING
364
+#if ENABLED(BABYSTEPPING)
365 365
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
366 366
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
367 367
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -378,7 +378,7 @@
378 378
 // so: v ^ 2 is proportional to number of steps we advance the extruder
379 379
 //#define ADVANCE
380 380
 
381
-#ifdef ADVANCE
381
+#if ENABLED(ADVANCE)
382 382
   #define EXTRUDER_ADVANCE_K .0
383 383
   #define D_FILAMENT 2.85
384 384
   #define STEPS_MM_E 836
@@ -405,7 +405,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
405 405
 
406 406
 // The number of linear motions that can be in the plan at any give time.
407 407
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
408
-#ifdef SDSUPPORT
408
+#if ENABLED(SDSUPPORT)
409 409
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
410 410
 #else
411 411
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -435,7 +435,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
435 435
 // the moves are than replaced by the firmware controlled ones.
436 436
 
437 437
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
438
-#ifdef FWRETRACT
438
+#if ENABLED(FWRETRACT)
439 439
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
440 440
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
441 441
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -447,9 +447,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
447 447
 #endif
448 448
 
449 449
 // Add support for experimental filament exchange support M600; requires display
450
-#ifdef ULTIPANEL
450
+#if ENABLED(ULTIPANEL)
451 451
   //#define FILAMENTCHANGEENABLE
452
-  #ifdef FILAMENTCHANGEENABLE
452
+  #if ENABLED(FILAMENTCHANGEENABLE)
453 453
     #define FILAMENTCHANGE_XPOS 3
454 454
     #define FILAMENTCHANGE_YPOS 3
455 455
     #define FILAMENTCHANGE_ZADD 10
@@ -469,7 +469,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
469 469
 // @section tmc
470 470
 
471 471
 //#define HAVE_TMCDRIVER
472
-#ifdef HAVE_TMCDRIVER
472
+#if ENABLED(HAVE_TMCDRIVER)
473 473
 
474 474
 //  #define X_IS_TMC
475 475
   #define X_MAX_CURRENT 1000  //in mA
@@ -531,7 +531,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
531 531
 // @section l6470
532 532
 
533 533
 //#define HAVE_L6470DRIVER
534
-#ifdef HAVE_L6470DRIVER
534
+#if ENABLED(HAVE_L6470DRIVER)
535 535
 
536 536
 //  #define X_IS_L6470
537 537
   #define X_MICROSTEPS 16     //number of microsteps

+ 36
- 36
Marlin/SanityCheck.h View File

@@ -9,21 +9,21 @@
9 9
   /**
10 10
    * Dual Stepper Drivers
11 11
    */
12
-  #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Y_DUAL_STEPPER_DRIVERS)
12
+  #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && ENABLED(Y_DUAL_STEPPER_DRIVERS)
13 13
     #error You cannot have dual stepper drivers for both Y and Z.
14 14
   #endif
15 15
 
16 16
   /**
17 17
    * Progress Bar
18 18
    */
19
-  #ifdef LCD_PROGRESS_BAR
20
-    #ifndef SDSUPPORT
19
+  #if ENABLED(LCD_PROGRESS_BAR)
20
+    #if DISABLED(SDSUPPORT)
21 21
       #error LCD_PROGRESS_BAR requires SDSUPPORT.
22 22
     #endif
23
-    #ifdef DOGLCD
23
+    #if ENABLED(DOGLCD)
24 24
       #error LCD_PROGRESS_BAR does not apply to graphical displays.
25 25
     #endif
26
-    #ifdef FILAMENT_LCD_DISPLAY
26
+    #if ENABLED(FILAMENT_LCD_DISPLAY)
27 27
       #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
28 28
     #endif
29 29
   #endif
@@ -31,14 +31,14 @@
31 31
   /**
32 32
    * Babystepping
33 33
    */
34
-  #ifdef BABYSTEPPING
35
-    #ifdef COREXY
34
+  #if ENABLED(BABYSTEPPING)
35
+    #if ENABLED(COREXY)
36 36
       #error BABYSTEPPING not implemented for COREXY yet.
37 37
     #endif
38
-    #ifdef SCARA
38
+    #if ENABLED(SCARA)
39 39
       #error BABYSTEPPING is not implemented for SCARA yet.
40 40
     #endif
41
-    #if defined(DELTA) && defined(BABYSTEP_XY)
41
+    #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
42 42
       #error BABYSTEPPING only implemented for Z axis on deltabots.
43 43
     #endif
44 44
   #endif
@@ -46,7 +46,7 @@
46 46
   /**
47 47
    * Filament Change with Extruder Runout Prevention
48 48
    */
49
-  #if defined(FILAMENTCHANGEENABLE) && defined(EXTRUDER_RUNOUT_PREVENT)
49
+  #if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
50 50
     #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE.
51 51
   #endif
52 52
 
@@ -59,19 +59,19 @@
59 59
       #error The maximum number of EXTRUDERS in Marlin is 4.
60 60
     #endif
61 61
 
62
-    #ifdef TEMP_SENSOR_1_AS_REDUNDANT
62
+    #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
63 63
       #error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT.
64 64
     #endif
65 65
 
66
-    #ifdef HEATERS_PARALLEL
66
+    #if ENABLED(HEATERS_PARALLEL)
67 67
       #error EXTRUDERS must be 1 with HEATERS_PARALLEL.
68 68
     #endif
69 69
 
70
-    #ifdef Y_DUAL_STEPPER_DRIVERS
70
+    #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
71 71
       #error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS.
72 72
     #endif
73 73
 
74
-    #ifdef Z_DUAL_STEPPER_DRIVERS
74
+    #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
75 75
       #error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS.
76 76
     #endif
77 77
 
@@ -98,25 +98,25 @@
98 98
   /**
99 99
    * Servo deactivation depends on servo endstops
100 100
    */
101
-  #if defined(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS
101
+  #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS
102 102
     #error At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE.
103 103
   #endif
104 104
 
105 105
   /**
106 106
    * Required LCD language
107 107
    */
108
-  #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)&& !defined(DISPLAY_CHARSET_HD44780_CYRILLIC)
108
+  #if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && DISABLED(DISPLAY_CHARSET_HD44780_JAPAN) && DISABLED(DISPLAY_CHARSET_HD44780_WESTERN) && DISABLED(DISPLAY_CHARSET_HD44780_CYRILLIC)
109 109
     #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN  or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
110 110
   #endif
111 111
 
112 112
   /**
113 113
    * Mesh Bed Leveling
114 114
    */
115
-  #ifdef MESH_BED_LEVELING
116
-    #ifdef DELTA
115
+  #if ENABLED(MESH_BED_LEVELING)
116
+    #if ENABLED(DELTA)
117 117
       #error MESH_BED_LEVELING does not yet support DELTA printers.
118 118
     #endif
119
-    #ifdef ENABLE_AUTO_BED_LEVELING
119
+    #if ENABLED(ENABLE_AUTO_BED_LEVELING)
120 120
       #error Select ENABLE_AUTO_BED_LEVELING or MESH_BED_LEVELING, not both.
121 121
     #endif
122 122
     #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7
@@ -127,14 +127,14 @@
127 127
   /**
128 128
    * Auto Bed Leveling
129 129
    */
130
-  #ifdef ENABLE_AUTO_BED_LEVELING
130
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
131 131
 
132 132
     /**
133 133
      * Require a Z Min pin
134 134
      */
135 135
     #if Z_MIN_PIN == -1
136
-      #if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
137
-        #ifdef Z_PROBE_REPEATABILITY_TEST
136
+      #if Z_PROBE_PIN == -1 || (DISABLED(Z_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
137
+        #if ENABLED(Z_PROBE_REPEATABILITY_TEST)
138 138
           #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
139 139
         #else
140 140
           #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin.
@@ -145,7 +145,7 @@
145 145
     /**
146 146
      * Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled.
147 147
      */
148
-    #if defined(Z_PROBE_ENDSTOP)
148
+    #if ENABLED(Z_PROBE_ENDSTOP)
149 149
       #ifndef Z_PROBE_PIN
150 150
         #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP.
151 151
       #endif
@@ -169,7 +169,7 @@
169 169
     /**
170 170
      * Check if Probe_Offset * Grid Points is greater than Probing Range
171 171
      */
172
-    #ifdef AUTO_BED_LEVELING_GRID
172
+    #if ENABLED(AUTO_BED_LEVELING_GRID)
173 173
       #ifndef DELTA_PROBABLE_RADIUS
174 174
         // Be sure points are in the right order
175 175
         #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
@@ -212,26 +212,26 @@
212 212
   /**
213 213
    * ULTIPANEL encoder
214 214
    */
215
-  #if defined(ULTIPANEL) && !defined(NEWPANEL) && !defined(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
215
+  #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
216 216
     #error ULTIPANEL requires some kind of encoder.
217 217
   #endif
218 218
 
219 219
   /**
220 220
    * Delta has limited bed leveling options
221 221
    */
222
-  #ifdef DELTA
222
+  #if ENABLED(DELTA)
223 223
 
224
-    #ifdef ENABLE_AUTO_BED_LEVELING
224
+    #if ENABLED(ENABLE_AUTO_BED_LEVELING)
225 225
 
226
-      #ifndef AUTO_BED_LEVELING_GRID
226
+      #if DISABLED(AUTO_BED_LEVELING_GRID)
227 227
         #error Only AUTO_BED_LEVELING_GRID is supported with DELTA.
228 228
       #endif
229 229
 
230
-      #ifdef Z_PROBE_SLED
230
+      #if ENABLED(Z_PROBE_SLED)
231 231
         #error You cannot use Z_PROBE_SLED with DELTA.
232 232
       #endif
233 233
 
234
-      #ifdef Z_PROBE_REPEATABILITY_TEST
234
+      #if ENABLED(Z_PROBE_REPEATABILITY_TEST)
235 235
         #error Z_PROBE_REPEATABILITY_TEST is not supported with DELTA yet.
236 236
       #endif
237 237
 
@@ -242,15 +242,15 @@
242 242
   /**
243 243
    * Allen Key Z Probe requires Auto Bed Leveling grid and Delta
244 244
    */
245
-  #if defined(Z_PROBE_ALLEN_KEY) && !(defined(AUTO_BED_LEVELING_GRID) && defined(DELTA))
245
+  #if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA))
246 246
     #error Invalid use of Z_PROBE_ALLEN_KEY.
247 247
   #endif
248 248
 
249 249
   /**
250 250
    * Dual X Carriage requirements
251 251
    */
252
-  #ifdef DUAL_X_CARRIAGE
253
-    #if EXTRUDERS == 1 || defined(COREXY) \
252
+  #if ENABLED(DUAL_X_CARRIAGE)
253
+    #if EXTRUDERS == 1 || ENABLED(COREXY) \
254 254
         || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
255 255
         || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
256 256
         || !HAS_X_MAX
@@ -311,7 +311,7 @@
311 311
     #endif
312 312
   #endif
313 313
 
314
-  #if EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
314
+  #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL)
315 315
     #if !HAS_HEATER_1
316 316
       #error HEATER_1_PIN not defined for this board.
317 317
     #endif
@@ -346,11 +346,11 @@
346 346
     #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds.
347 347
   #endif
348 348
 
349
-  #if !defined(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
349
+  #if DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
350 350
     #error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS.
351 351
   #endif
352 352
 
353
-  #if !defined(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
353
+  #if DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
354 354
     #error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED.
355 355
   #endif
356 356
 

+ 14
- 14
Marlin/example_configurations/Felix/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -237,7 +237,7 @@ Here are some standard links for getting your machine calibrated:
237 237
 
238 238
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
239 239
 
240
-#ifdef PIDTEMPBED
240
+#if ENABLED(PIDTEMPBED)
241 241
 
242 242
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
243 243
 
@@ -390,7 +390,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
390 390
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
391 391
                                  // It is assumed that when logic high = filament available
392 392
                                  //                    when logic  low = filament ran out
393
-#ifdef FILAMENT_RUNOUT_SENSOR
393
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
394 394
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
395 395
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
396 396
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -403,11 +403,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
403 403
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
404 404
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
405 405
 
406
-#ifdef MANUAL_BED_LEVELING
406
+#if ENABLED(MANUAL_BED_LEVELING)
407 407
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
408 408
 #endif  // MANUAL_BED_LEVELING
409 409
 
410
-#ifdef MESH_BED_LEVELING
410
+#if ENABLED(MESH_BED_LEVELING)
411 411
   #define MESH_MIN_X 10
412 412
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
413 413
   #define MESH_MIN_Y 10
@@ -426,7 +426,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
426 426
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
427 427
 //#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
428 428
 
429
-#ifdef ENABLE_AUTO_BED_LEVELING
429
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
430 430
 
431 431
   // There are 2 different ways to specify probing locations
432 432
   //
@@ -443,7 +443,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
443 443
   // Note: this feature generates 10KB extra code size
444 444
   #define AUTO_BED_LEVELING_GRID
445 445
 
446
-  #ifdef AUTO_BED_LEVELING_GRID
446
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
447 447
 
448 448
     #define LEFT_PROBE_BED_POSITION 15
449 449
     #define RIGHT_PROBE_BED_POSITION 170
@@ -500,7 +500,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
500 500
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
501 501
                           // - Block Z homing only when the probe is outside bed area.
502 502
 
503
-  #ifdef Z_SAFE_HOMING
503
+  #if ENABLED(Z_SAFE_HOMING)
504 504
 
505 505
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
506 506
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -532,7 +532,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
532 532
 
533 533
 // Manual homing switch locations:
534 534
 // For deltabots this means top and center of the Cartesian print volume.
535
-#ifdef MANUAL_HOME_POSITIONS
535
+#if ENABLED(MANUAL_HOME_POSITIONS)
536 536
   #define MANUAL_X_HOME_POS 0
537 537
   #define MANUAL_Y_HOME_POS 0
538 538
   #define MANUAL_Z_HOME_POS 0
@@ -572,8 +572,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
572 572
 
573 573
 // Custom M code points
574 574
 #define CUSTOM_M_CODES
575
-#ifdef CUSTOM_M_CODES
576
-  #ifdef ENABLE_AUTO_BED_LEVELING
575
+#if ENABLED(CUSTOM_M_CODES)
576
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
577 577
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
578 578
     #define Z_PROBE_OFFSET_RANGE_MIN -20
579 579
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -590,7 +590,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
590 590
 //define this to enable EEPROM support
591 591
 //#define EEPROM_SETTINGS
592 592
 
593
-#ifdef EEPROM_SETTINGS
593
+#if ENABLED(EEPROM_SETTINGS)
594 594
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
595 595
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
596 596
 #endif
@@ -774,7 +774,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
774 774
 // With this option servos are powered only during movement, then turned off to prevent jitter.
775 775
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
776 776
 
777
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
777
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
778 778
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
779 779
   // 300ms is a good value but you can try less delay.
780 780
   // If the servo can't reach the requested position, increase it.

+ 12
- 12
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -184,7 +184,7 @@ Here are some standard links for getting your machine calibrated:
184 184
 #define PIDTEMP
185 185
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
186 186
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
187
-#ifdef PIDTEMP
187
+#if ENABLED(PIDTEMP)
188 188
   //#define PID_DEBUG // Sends debug data to the serial port.
189 189
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
190 190
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -226,7 +226,7 @@ Here are some standard links for getting your machine calibrated:
226 226
 
227 227
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
228 228
 
229
-#ifdef PIDTEMPBED
229
+#if ENABLED(PIDTEMPBED)
230 230
 // Felix Foil Heater
231 231
    #define DEFAULT_bedKp 103.37
232 232
    #define DEFAULT_bedKi 2.79
@@ -353,7 +353,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
353 353
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
354 354
                                  // It is assumed that when logic high = filament available
355 355
                                  //                    when logic  low = filament ran out
356
-#ifdef FILAMENT_RUNOUT_SENSOR
356
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
357 357
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
358 358
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
359 359
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -366,7 +366,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
366 366
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
367 367
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
368 368
 
369
-#ifdef MESH_BED_LEVELING
369
+#if ENABLED(MESH_BED_LEVELING)
370 370
   #define MESH_MIN_X 10
371 371
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
372 372
   #define MESH_MIN_Y 10
@@ -383,7 +383,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
383 383
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
384 384
 //#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
385 385
 
386
-#ifdef ENABLE_AUTO_BED_LEVELING
386
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
387 387
 
388 388
   // There are 2 different ways to specify probing locations
389 389
   //
@@ -400,7 +400,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
400 400
   // Note: this feature generates 10KB extra code size
401 401
   #define AUTO_BED_LEVELING_GRID
402 402
 
403
-  #ifdef AUTO_BED_LEVELING_GRID
403
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
404 404
 
405 405
     #define LEFT_PROBE_BED_POSITION 15
406 406
     #define RIGHT_PROBE_BED_POSITION 170
@@ -461,7 +461,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
461 461
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
462 462
                           // - Block Z homing only when the probe is outside bed area.
463 463
 
464
-  #ifdef Z_SAFE_HOMING
464
+  #if ENABLED(Z_SAFE_HOMING)
465 465
 
466 466
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
467 467
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -491,7 +491,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
491 491
 
492 492
 // Manual homing switch locations:
493 493
 // For deltabots this means top and center of the Cartesian print volume.
494
-#ifdef MANUAL_HOME_POSITIONS
494
+#if ENABLED(MANUAL_HOME_POSITIONS)
495 495
   #define MANUAL_X_HOME_POS 0
496 496
   #define MANUAL_Y_HOME_POS 0
497 497
   #define MANUAL_Z_HOME_POS 0
@@ -533,8 +533,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
533 533
 
534 534
 // Custom M code points
535 535
 #define CUSTOM_M_CODES
536
-#ifdef CUSTOM_M_CODES
537
-  #ifdef ENABLE_AUTO_BED_LEVELING
536
+#if ENABLED(CUSTOM_M_CODES)
537
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
538 538
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
539 539
     #define Z_PROBE_OFFSET_RANGE_MIN -20
540 540
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -550,7 +550,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
550 550
 //define this to enable EEPROM support
551 551
 //#define EEPROM_SETTINGS
552 552
 
553
-#ifdef EEPROM_SETTINGS
553
+#if ENABLED(EEPROM_SETTINGS)
554 554
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
555 555
   #define EEPROM_CHITCHAT // please keep turned on if you can.
556 556
 #endif

+ 22
- 22
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 2.85
391 391
   #define STEPS_MM_E 836
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 14
- 14
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -198,7 +198,7 @@ Here are some standard links for getting your machine calibrated:
198 198
 #define PIDTEMP
199 199
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
200 200
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
201
-#ifdef PIDTEMP
201
+#if ENABLED(PIDTEMP)
202 202
   //#define PID_DEBUG // Sends debug data to the serial port.
203 203
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
204 204
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -240,7 +240,7 @@ Here are some standard links for getting your machine calibrated:
240 240
 
241 241
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
242 242
 
243
-#ifdef PIDTEMPBED
243
+#if ENABLED(PIDTEMPBED)
244 244
 
245 245
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
246 246
 
@@ -400,7 +400,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
400 400
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
401 401
                                  // It is assumed that when logic high = filament available
402 402
                                  //                    when logic  low = filament ran out
403
-#ifdef FILAMENT_RUNOUT_SENSOR
403
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
404 404
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
405 405
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
406 406
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -413,11 +413,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
413 413
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
414 414
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
415 415
 
416
-#ifdef MANUAL_BED_LEVELING
416
+#if ENABLED(MANUAL_BED_LEVELING)
417 417
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
418 418
 #endif  // MANUAL_BED_LEVELING
419 419
 
420
-#ifdef MESH_BED_LEVELING
420
+#if ENABLED(MESH_BED_LEVELING)
421 421
   #define MESH_MIN_X 10
422 422
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
423 423
   #define MESH_MIN_Y 10
@@ -436,7 +436,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
436 436
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
437 437
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
438 438
 
439
-#ifdef ENABLE_AUTO_BED_LEVELING
439
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
440 440
 
441 441
   // There are 2 different ways to specify probing locations
442 442
   //
@@ -453,7 +453,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
453 453
   // Note: this feature generates 10KB extra code size
454 454
   #define AUTO_BED_LEVELING_GRID
455 455
 
456
-  #ifdef AUTO_BED_LEVELING_GRID
456
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
457 457
 
458 458
     #define LEFT_PROBE_BED_POSITION 15
459 459
     #define RIGHT_PROBE_BED_POSITION 170
@@ -510,7 +510,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
510 510
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
511 511
                           // - Block Z homing only when the probe is outside bed area.
512 512
 
513
-  #ifdef Z_SAFE_HOMING
513
+  #if ENABLED(Z_SAFE_HOMING)
514 514
 
515 515
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
516 516
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -542,7 +542,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
542 542
 
543 543
 // Manual homing switch locations:
544 544
 // For deltabots this means top and center of the Cartesian print volume.
545
-#ifdef MANUAL_HOME_POSITIONS
545
+#if ENABLED(MANUAL_HOME_POSITIONS)
546 546
   #define MANUAL_X_HOME_POS 0
547 547
   #define MANUAL_Y_HOME_POS 0
548 548
   #define MANUAL_Z_HOME_POS 0
@@ -581,8 +581,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
581 581
 
582 582
 // Custom M code points
583 583
 #define CUSTOM_M_CODES
584
-#ifdef CUSTOM_M_CODES
585
-  #ifdef ENABLE_AUTO_BED_LEVELING
584
+#if ENABLED(CUSTOM_M_CODES)
585
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
586 586
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
587 587
     #define Z_PROBE_OFFSET_RANGE_MIN -20
588 588
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -599,7 +599,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
599 599
 //define this to enable EEPROM support
600 600
 //#define EEPROM_SETTINGS
601 601
 
602
-#ifdef EEPROM_SETTINGS
602
+#if ENABLED(EEPROM_SETTINGS)
603 603
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
604 604
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
605 605
 #endif
@@ -783,7 +783,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
783 783
 // With this option servos are powered only during movement, then turned off to prevent jitter.
784 784
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
785 785
 
786
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
786
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
787 787
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
788 788
   // 300ms is a good value but you can try less delay.
789 789
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60}  // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 1.75
391 391
   #define STEPS_MM_E 100.47095761381482
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 14
- 14
Marlin/example_configurations/K8200/Configuration.h View File

@@ -43,7 +43,7 @@ Here are some standard links for getting your machine calibrated:
43 43
 
44 44
 // @section info
45 45
 
46
-#ifdef HAS_AUTOMATIC_VERSIONING
46
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
47 47
   #include "_Version.h"
48 48
 #else
49 49
   #include "Default_Version.h"
@@ -200,7 +200,7 @@ Here are some standard links for getting your machine calibrated:
200 200
 #define PIDTEMP
201 201
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
202 202
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
203
-#ifdef PIDTEMP
203
+#if ENABLED(PIDTEMP)
204 204
   //#define PID_DEBUG // Sends debug data to the serial port.
205 205
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
206 206
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -242,7 +242,7 @@ Here are some standard links for getting your machine calibrated:
242 242
 
243 243
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
244 244
 
245
-#ifdef PIDTEMPBED
245
+#if ENABLED(PIDTEMPBED)
246 246
 
247 247
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
248 248
 
@@ -396,7 +396,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
396 396
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
397 397
                                  // It is assumed that when logic high = filament available
398 398
                                  //                    when logic  low = filament ran out
399
-#ifdef FILAMENT_RUNOUT_SENSOR
399
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
400 400
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
401 401
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
402 402
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -409,11 +409,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
409 409
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
410 410
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
411 411
 
412
-#ifdef MANUAL_BED_LEVELING
412
+#if ENABLED(MANUAL_BED_LEVELING)
413 413
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
414 414
 #endif  // MANUAL_BED_LEVELING
415 415
 
416
-#ifdef MESH_BED_LEVELING
416
+#if ENABLED(MESH_BED_LEVELING)
417 417
   #define MESH_MIN_X 10
418 418
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
419 419
   #define MESH_MIN_Y 10
@@ -432,7 +432,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
432 432
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
433 433
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
434 434
 
435
-#ifdef ENABLE_AUTO_BED_LEVELING
435
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
436 436
 
437 437
   // There are 2 different ways to specify probing locations
438 438
   //
@@ -449,7 +449,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
449 449
   // Note: this feature generates 10KB extra code size
450 450
   #define AUTO_BED_LEVELING_GRID
451 451
 
452
-  #ifdef AUTO_BED_LEVELING_GRID
452
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
453 453
 
454 454
     #define LEFT_PROBE_BED_POSITION 15
455 455
     #define RIGHT_PROBE_BED_POSITION 170
@@ -506,7 +506,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
506 506
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
507 507
                           // - Block Z homing only when the probe is outside bed area.
508 508
 
509
-  #ifdef Z_SAFE_HOMING
509
+  #if ENABLED(Z_SAFE_HOMING)
510 510
 
511 511
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
512 512
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -538,7 +538,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
538 538
 
539 539
 // Manual homing switch locations:
540 540
 // For deltabots this means top and center of the Cartesian print volume.
541
-#ifdef MANUAL_HOME_POSITIONS
541
+#if ENABLED(MANUAL_HOME_POSITIONS)
542 542
   #define MANUAL_X_HOME_POS 0
543 543
   #define MANUAL_Y_HOME_POS 0
544 544
   #define MANUAL_Z_HOME_POS 0
@@ -577,8 +577,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
577 577
 
578 578
 // Custom M code points
579 579
 #define CUSTOM_M_CODES
580
-#ifdef CUSTOM_M_CODES
581
-  #ifdef ENABLE_AUTO_BED_LEVELING
580
+#if ENABLED(CUSTOM_M_CODES)
581
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
582 582
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
583 583
     #define Z_PROBE_OFFSET_RANGE_MIN -20
584 584
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -595,7 +595,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
595 595
 //define this to enable EEPROM support
596 596
 #define EEPROM_SETTINGS
597 597
 
598
-#ifdef EEPROM_SETTINGS
598
+#if ENABLED(EEPROM_SETTINGS)
599 599
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
600 600
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
601 601
 #endif
@@ -779,7 +779,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
779 779
 // With this option servos are powered only during movement, then turned off to prevent jitter.
780 780
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
781 781
 
782
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
782
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
783 783
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
784 784
   // 300ms is a good value but you can try less delay.
785 785
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 2.85
391 391
   #define STEPS_MM_E 836
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 14
- 14
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated:
248 248
 
249 249
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
250 250
 
251
-#ifdef PIDTEMPBED
251
+#if ENABLED(PIDTEMPBED)
252 252
 
253 253
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
254 254
 
@@ -408,7 +408,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
408 408
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
409 409
                                  // It is assumed that when logic high = filament available
410 410
                                  //                    when logic  low = filament ran out
411
-#ifdef FILAMENT_RUNOUT_SENSOR
411
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
412 412
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
413 413
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
414 414
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -421,11 +421,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
421 421
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
422 422
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
423 423
 
424
-#ifdef MANUAL_BED_LEVELING
424
+#if ENABLED(MANUAL_BED_LEVELING)
425 425
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
426 426
 #endif  // MANUAL_BED_LEVELING
427 427
 
428
-#ifdef MESH_BED_LEVELING
428
+#if ENABLED(MESH_BED_LEVELING)
429 429
   #define MESH_MIN_X 10
430 430
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
431 431
   #define MESH_MIN_Y 10
@@ -444,7 +444,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
444 444
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
445 445
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
446 446
 
447
-#ifdef ENABLE_AUTO_BED_LEVELING
447
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
448 448
 
449 449
   // There are 2 different ways to specify probing locations
450 450
   //
@@ -461,7 +461,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
461 461
   // Note: this feature generates 10KB extra code size
462 462
   #define AUTO_BED_LEVELING_GRID
463 463
 
464
-  #ifdef AUTO_BED_LEVELING_GRID
464
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
465 465
 
466 466
     #define LEFT_PROBE_BED_POSITION 15
467 467
     #define RIGHT_PROBE_BED_POSITION 170
@@ -518,7 +518,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
518 518
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
519 519
                           // - Block Z homing only when the probe is outside bed area.
520 520
 
521
-  #ifdef Z_SAFE_HOMING
521
+  #if ENABLED(Z_SAFE_HOMING)
522 522
 
523 523
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
524 524
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -550,7 +550,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
550 550
 
551 551
 // Manual homing switch locations:
552 552
 // For deltabots this means top and center of the Cartesian print volume.
553
-#ifdef MANUAL_HOME_POSITIONS
553
+#if ENABLED(MANUAL_HOME_POSITIONS)
554 554
   #define MANUAL_X_HOME_POS 0
555 555
   #define MANUAL_Y_HOME_POS 0
556 556
   #define MANUAL_Z_HOME_POS 0
@@ -589,8 +589,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
589 589
 
590 590
 // Custom M code points
591 591
 #define CUSTOM_M_CODES
592
-#ifdef CUSTOM_M_CODES
593
-  #ifdef ENABLE_AUTO_BED_LEVELING
592
+#if ENABLED(CUSTOM_M_CODES)
593
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
594 594
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
595 595
     #define Z_PROBE_OFFSET_RANGE_MIN -20
596 596
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -607,7 +607,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
607 607
 //define this to enable EEPROM support
608 608
 //#define EEPROM_SETTINGS
609 609
 
610
-#ifdef EEPROM_SETTINGS
610
+#if ENABLED(EEPROM_SETTINGS)
611 611
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
612 612
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
613 613
 #endif
@@ -791,7 +791,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
791 791
 // With this option servos are powered only during movement, then turned off to prevent jitter.
792 792
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
793 793
 
794
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
794
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
795 795
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
796 796
   // 300ms is a good value but you can try less delay.
797 797
   // If the servo can't reach the requested position, increase it.

+ 14
- 14
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -238,7 +238,7 @@ Here are some standard links for getting your machine calibrated:
238 238
 
239 239
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
240 240
 
241
-#ifdef PIDTEMPBED
241
+#if ENABLED(PIDTEMPBED)
242 242
 
243 243
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
244 244
 
@@ -388,7 +388,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
388 388
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
389 389
                                  // It is assumed that when logic high = filament available
390 390
                                  //                    when logic  low = filament ran out
391
-#ifdef FILAMENT_RUNOUT_SENSOR
391
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
392 392
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
393 393
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
394 394
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -401,11 +401,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
401 401
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
402 402
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
403 403
 
404
-#ifdef MANUAL_BED_LEVELING
404
+#if ENABLED(MANUAL_BED_LEVELING)
405 405
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
406 406
 #endif  // MANUAL_BED_LEVELING
407 407
 
408
-#ifdef MESH_BED_LEVELING
408
+#if ENABLED(MESH_BED_LEVELING)
409 409
   #define MESH_MIN_X 10
410 410
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
411 411
   #define MESH_MIN_Y 10
@@ -424,7 +424,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
424 424
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
425 425
 //#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
426 426
 
427
-#ifdef ENABLE_AUTO_BED_LEVELING
427
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
428 428
 
429 429
   // There are 2 different ways to specify probing locations
430 430
   //
@@ -441,7 +441,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
441 441
   // Note: this feature generates 10KB extra code size
442 442
   #define AUTO_BED_LEVELING_GRID
443 443
 
444
-  #ifdef AUTO_BED_LEVELING_GRID
444
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
445 445
 
446 446
     #define LEFT_PROBE_BED_POSITION 15
447 447
     #define RIGHT_PROBE_BED_POSITION 170
@@ -498,7 +498,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
498 498
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
499 499
                           // - Block Z homing only when the probe is outside bed area.
500 500
 
501
-  #ifdef Z_SAFE_HOMING
501
+  #if ENABLED(Z_SAFE_HOMING)
502 502
 
503 503
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
504 504
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -530,7 +530,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
530 530
 
531 531
 // Manual homing switch locations:
532 532
 // For deltabots this means top and center of the Cartesian print volume.
533
-#ifdef MANUAL_HOME_POSITIONS
533
+#if ENABLED(MANUAL_HOME_POSITIONS)
534 534
   #define MANUAL_X_HOME_POS 0
535 535
   #define MANUAL_Y_HOME_POS 0
536 536
   #define MANUAL_Z_HOME_POS 0
@@ -569,8 +569,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
569 569
 
570 570
 // Custom M code points
571 571
 #define CUSTOM_M_CODES
572
-#ifdef CUSTOM_M_CODES
573
-  #ifdef ENABLE_AUTO_BED_LEVELING
572
+#if ENABLED(CUSTOM_M_CODES)
573
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
574 574
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
575 575
     #define Z_PROBE_OFFSET_RANGE_MIN -20
576 576
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -587,7 +587,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
587 587
 //define this to enable EEPROM support
588 588
 //#define EEPROM_SETTINGS
589 589
 
590
-#ifdef EEPROM_SETTINGS
590
+#if ENABLED(EEPROM_SETTINGS)
591 591
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
592 592
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
593 593
 #endif
@@ -774,7 +774,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
774 774
 // With this option servos are powered only during movement, then turned off to prevent jitter.
775 775
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
776 776
 
777
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
777
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
778 778
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
779 779
   // 300ms is a good value but you can try less delay.
780 780
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,16 +31,16 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
38 38
 
39
-#ifdef PIDTEMP
39
+#if ENABLED(PIDTEMP)
40 40
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
41 41
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
42 42
   #define PID_ADD_EXTRUSION_RATE
43
-  #ifdef PID_ADD_EXTRUSION_RATE
43
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
44 44
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
45 45
   #endif
46 46
 #endif
@@ -56,7 +56,7 @@
56 56
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
57 57
  */
58 58
 #define AUTOTEMP
59
-#ifdef AUTOTEMP
59
+#if ENABLED(AUTOTEMP)
60 60
   #define AUTOTEMP_OLDWEIGHT 0.98
61 61
 #endif
62 62
 
@@ -133,7 +133,7 @@
133 133
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
134 134
 //#define Z_DUAL_STEPPER_DRIVERS
135 135
 
136
-#ifdef Z_DUAL_STEPPER_DRIVERS
136
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
137 137
 
138 138
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
139 139
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -150,7 +150,7 @@
150 150
 
151 151
   // #define Z_DUAL_ENDSTOPS
152 152
 
153
-  #ifdef Z_DUAL_ENDSTOPS
153
+  #if ENABLED(Z_DUAL_ENDSTOPS)
154 154
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
155 155
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
156 156
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -169,7 +169,7 @@
169 169
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
170 170
 // allowing faster printing speeds.
171 171
 //#define DUAL_X_CARRIAGE
172
-#ifdef DUAL_X_CARRIAGE
172
+#if ENABLED(DUAL_X_CARRIAGE)
173 173
   // Configuration for second X-carriage
174 174
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
175 175
   // the second x-carriage always homes to the maximum endstop.
@@ -240,7 +240,7 @@
240 240
 
241 241
 // @section lcd
242 242
 
243
-#ifdef ULTIPANEL
243
+#if ENABLED(ULTIPANEL)
244 244
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
245 245
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 246
 #endif
@@ -289,7 +289,7 @@
289 289
 
290 290
 // @section lcd
291 291
 
292
-#ifdef SDSUPPORT
292
+#if ENABLED(SDSUPPORT)
293 293
 
294 294
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
295 295
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -310,7 +310,7 @@
310 310
   // Show a progress bar on HD44780 LCDs for SD printing
311 311
   //#define LCD_PROGRESS_BAR
312 312
 
313
-  #ifdef LCD_PROGRESS_BAR
313
+  #if ENABLED(LCD_PROGRESS_BAR)
314 314
     // Amount of time (ms) to show the bar
315 315
     #define PROGRESS_BAR_BAR_TIME 2000
316 316
     // Amount of time (ms) to show the status message
@@ -333,7 +333,7 @@
333 333
 #endif // SDSUPPORT
334 334
 
335 335
 // for dogm lcd displays you can choose some additional fonts:
336
-#ifdef DOGLCD
336
+#if ENABLED(DOGLCD)
337 337
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
338 338
   // we don't have a big font for Cyrillic, Kana
339 339
   //#define USE_BIG_EDIT_FONT
@@ -348,7 +348,7 @@
348 348
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
349 349
 //#define USE_WATCHDOG
350 350
 
351
-#ifdef USE_WATCHDOG
351
+#if ENABLED(USE_WATCHDOG)
352 352
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
353 353
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
354 354
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -361,7 +361,7 @@
361 361
 // it can e.g. be used to change z-positions in the print startup phase in real-time
362 362
 // does not respect endstops!
363 363
 //#define BABYSTEPPING
364
-#ifdef BABYSTEPPING
364
+#if ENABLED(BABYSTEPPING)
365 365
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
366 366
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
367 367
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -378,7 +378,7 @@
378 378
 // so: v ^ 2 is proportional to number of steps we advance the extruder
379 379
 //#define ADVANCE
380 380
 
381
-#ifdef ADVANCE
381
+#if ENABLED(ADVANCE)
382 382
   #define EXTRUDER_ADVANCE_K .0
383 383
   #define D_FILAMENT 1.75
384 384
   #define STEPS_MM_E 836
@@ -405,7 +405,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
405 405
 
406 406
 // The number of linear motions that can be in the plan at any give time.
407 407
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
408
-#ifdef SDSUPPORT
408
+#if ENABLED(SDSUPPORT)
409 409
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
410 410
 #else
411 411
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -435,7 +435,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
435 435
 // the moves are than replaced by the firmware controlled ones.
436 436
 
437 437
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
438
-#ifdef FWRETRACT
438
+#if ENABLED(FWRETRACT)
439 439
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
440 440
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
441 441
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -447,9 +447,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
447 447
 #endif
448 448
 
449 449
 // Add support for experimental filament exchange support M600; requires display
450
-#ifdef ULTIPANEL
450
+#if ENABLED(ULTIPANEL)
451 451
   //#define FILAMENTCHANGEENABLE
452
-  #ifdef FILAMENTCHANGEENABLE
452
+  #if ENABLED(FILAMENTCHANGEENABLE)
453 453
     #define FILAMENTCHANGE_XPOS 3
454 454
     #define FILAMENTCHANGE_YPOS 3
455 455
     #define FILAMENTCHANGE_ZADD 10
@@ -469,7 +469,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
469 469
 // @section tmc
470 470
 
471 471
 //#define HAVE_TMCDRIVER
472
-#ifdef HAVE_TMCDRIVER
472
+#if ENABLED(HAVE_TMCDRIVER)
473 473
 
474 474
 //  #define X_IS_TMC
475 475
   #define X_MAX_CURRENT 1000  //in mA
@@ -531,7 +531,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
531 531
 // @section l6470
532 532
 
533 533
 //#define HAVE_L6470DRIVER
534
-#ifdef HAVE_L6470DRIVER
534
+#if ENABLED(HAVE_L6470DRIVER)
535 535
 
536 536
 //  #define X_IS_L6470
537 537
   #define X_MICROSTEPS 16     //number of microsteps

+ 14
- 14
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -63,7 +63,7 @@ Here are some standard links for getting your machine calibrated:
63 63
 
64 64
 // @section info
65 65
 
66
-#ifdef HAS_AUTOMATIC_VERSIONING
66
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
67 67
   #include "_Version.h"
68 68
 #else
69 69
   #include "Default_Version.h"
@@ -220,7 +220,7 @@ Here are some standard links for getting your machine calibrated:
220 220
 #define PIDTEMP
221 221
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
222 222
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
223
-#ifdef PIDTEMP
223
+#if ENABLED(PIDTEMP)
224 224
   //#define PID_DEBUG // Sends debug data to the serial port.
225 225
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
226 226
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -262,7 +262,7 @@ Here are some standard links for getting your machine calibrated:
262 262
 
263 263
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
264 264
 
265
-#ifdef PIDTEMPBED
265
+#if ENABLED(PIDTEMPBED)
266 266
 
267 267
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
268 268
 
@@ -416,7 +416,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
416 416
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
417 417
                                  // It is assumed that when logic high = filament available
418 418
                                  //                    when logic  low = filament ran out
419
-#ifdef FILAMENT_RUNOUT_SENSOR
419
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
420 420
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
421 421
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
422 422
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -429,11 +429,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
429 429
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
430 430
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
431 431
 
432
-#ifdef MANUAL_BED_LEVELING
432
+#if ENABLED(MANUAL_BED_LEVELING)
433 433
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
434 434
 #endif  // MANUAL_BED_LEVELING
435 435
 
436
-#ifdef MESH_BED_LEVELING
436
+#if ENABLED(MESH_BED_LEVELING)
437 437
   #define MESH_MIN_X 10
438 438
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
439 439
   #define MESH_MIN_Y 10
@@ -452,7 +452,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
452 452
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
453 453
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
454 454
 
455
-#ifdef ENABLE_AUTO_BED_LEVELING
455
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
456 456
 
457 457
   // There are 2 different ways to specify probing locations
458 458
   //
@@ -469,7 +469,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
469 469
   // Note: this feature generates 10KB extra code size
470 470
   #define AUTO_BED_LEVELING_GRID
471 471
 
472
-  #ifdef AUTO_BED_LEVELING_GRID
472
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
473 473
 
474 474
     #define LEFT_PROBE_BED_POSITION 15
475 475
     #define RIGHT_PROBE_BED_POSITION 170
@@ -526,7 +526,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
526 526
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
527 527
                           // - Block Z homing only when the probe is outside bed area.
528 528
 
529
-  #ifdef Z_SAFE_HOMING
529
+  #if ENABLED(Z_SAFE_HOMING)
530 530
 
531 531
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
532 532
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -558,7 +558,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
558 558
 
559 559
 // Manual homing switch locations:
560 560
 // For deltabots this means top and center of the Cartesian print volume.
561
-#ifdef MANUAL_HOME_POSITIONS
561
+#if ENABLED(MANUAL_HOME_POSITIONS)
562 562
   // For SCARA: Offset between HomingPosition and Bed X=0 / Y=0
563 563
   #define MANUAL_X_HOME_POS -22.
564 564
   #define MANUAL_Y_HOME_POS -52.
@@ -597,8 +597,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
597 597
 
598 598
 // Custom M code points
599 599
 //#define CUSTOM_M_CODES
600
-#ifdef CUSTOM_M_CODES
601
-  #ifdef ENABLE_AUTO_BED_LEVELING
600
+#if ENABLED(CUSTOM_M_CODES)
601
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
602 602
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
603 603
     #define Z_PROBE_OFFSET_RANGE_MIN -20
604 604
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -615,7 +615,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
615 615
 //define this to enable EEPROM support
616 616
 //#define EEPROM_SETTINGS
617 617
 
618
-#ifdef EEPROM_SETTINGS
618
+#if ENABLED(EEPROM_SETTINGS)
619 619
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
620 620
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
621 621
 #endif
@@ -799,7 +799,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
799 799
 // With this option servos are powered only during movement, then turned off to prevent jitter.
800 800
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
801 801
 
802
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
802
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
803 803
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
804 804
   // 300ms is a good value but you can try less delay.
805 805
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 3000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 10*60, 60}  // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 #define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 1.75
391 391
   #define STEPS_MM_E 1000
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 14
- 14
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -198,7 +198,7 @@ Here are some standard links for getting your machine calibrated:
198 198
 #define PIDTEMP
199 199
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
200 200
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
201
-#ifdef PIDTEMP
201
+#if ENABLED(PIDTEMP)
202 202
   //#define PID_DEBUG // Sends debug data to the serial port.
203 203
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
204 204
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -240,7 +240,7 @@ Here are some standard links for getting your machine calibrated:
240 240
 
241 241
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
242 242
 
243
-#ifdef PIDTEMPBED
243
+#if ENABLED(PIDTEMPBED)
244 244
 
245 245
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
246 246
 
@@ -400,7 +400,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
400 400
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
401 401
                                  // It is assumed that when logic high = filament available
402 402
                                  //                    when logic  low = filament ran out
403
-#ifdef FILAMENT_RUNOUT_SENSOR
403
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
404 404
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
405 405
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
406 406
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -413,11 +413,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
413 413
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
414 414
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
415 415
 
416
-#ifdef MANUAL_BED_LEVELING
416
+#if ENABLED(MANUAL_BED_LEVELING)
417 417
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
418 418
 #endif  // MANUAL_BED_LEVELING
419 419
 
420
-#ifdef MESH_BED_LEVELING
420
+#if ENABLED(MESH_BED_LEVELING)
421 421
   #define MESH_MIN_X 10
422 422
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
423 423
   #define MESH_MIN_Y 10
@@ -436,7 +436,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
436 436
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
437 437
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
438 438
 
439
-#ifdef ENABLE_AUTO_BED_LEVELING
439
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
440 440
 
441 441
   // There are 2 different ways to specify probing locations
442 442
   //
@@ -453,7 +453,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
453 453
   // Note: this feature generates 10KB extra code size
454 454
   #define AUTO_BED_LEVELING_GRID
455 455
 
456
-  #ifdef AUTO_BED_LEVELING_GRID
456
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
457 457
 
458 458
     #define LEFT_PROBE_BED_POSITION 15
459 459
     #define RIGHT_PROBE_BED_POSITION 170
@@ -510,7 +510,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
510 510
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
511 511
                           // - Block Z homing only when the probe is outside bed area.
512 512
 
513
-  #ifdef Z_SAFE_HOMING
513
+  #if ENABLED(Z_SAFE_HOMING)
514 514
 
515 515
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
516 516
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -542,7 +542,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
542 542
 
543 543
 // Manual homing switch locations:
544 544
 // For deltabots this means top and center of the Cartesian print volume.
545
-#ifdef MANUAL_HOME_POSITIONS
545
+#if ENABLED(MANUAL_HOME_POSITIONS)
546 546
   #define MANUAL_X_HOME_POS 0
547 547
   #define MANUAL_Y_HOME_POS 0
548 548
   #define MANUAL_Z_HOME_POS 0
@@ -581,8 +581,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
581 581
 
582 582
 // Custom M code points
583 583
 #define CUSTOM_M_CODES
584
-#ifdef CUSTOM_M_CODES
585
-  #ifdef ENABLE_AUTO_BED_LEVELING
584
+#if ENABLED(CUSTOM_M_CODES)
585
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
586 586
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
587 587
     #define Z_PROBE_OFFSET_RANGE_MIN -20
588 588
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -599,7 +599,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
599 599
 //define this to enable EEPROM support
600 600
 //#define EEPROM_SETTINGS
601 601
 
602
-#ifdef EEPROM_SETTINGS
602
+#if ENABLED(EEPROM_SETTINGS)
603 603
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
604 604
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
605 605
 #endif
@@ -783,7 +783,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
783 783
 // With this option servos are powered only during movement, then turned off to prevent jitter.
784 784
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
785 785
 
786
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
786
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
787 787
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
788 788
   // 300ms is a good value but you can try less delay.
789 789
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60}  // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 1.75
391 391
   #define STEPS_MM_E 100.47095761381482
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 14
- 14
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated:
248 248
 
249 249
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
250 250
 
251
-#ifdef PIDTEMPBED
251
+#if ENABLED(PIDTEMPBED)
252 252
 
253 253
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
254 254
 
@@ -408,7 +408,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
408 408
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
409 409
                                  // It is assumed that when logic high = filament available
410 410
                                  //                    when logic  low = filament ran out
411
-#ifdef FILAMENT_RUNOUT_SENSOR
411
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
412 412
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
413 413
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
414 414
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -421,11 +421,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
421 421
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
422 422
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
423 423
 
424
-#ifdef MANUAL_BED_LEVELING
424
+#if ENABLED(MANUAL_BED_LEVELING)
425 425
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
426 426
 #endif  // MANUAL_BED_LEVELING
427 427
 
428
-#ifdef MESH_BED_LEVELING
428
+#if ENABLED(MESH_BED_LEVELING)
429 429
   #define MESH_MIN_X 10
430 430
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
431 431
   #define MESH_MIN_Y 10
@@ -444,7 +444,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
444 444
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
445 445
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
446 446
 
447
-#ifdef ENABLE_AUTO_BED_LEVELING
447
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
448 448
 
449 449
   // There are 2 different ways to specify probing locations
450 450
   //
@@ -461,7 +461,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
461 461
   // Note: this feature generates 10KB extra code size
462 462
   #define AUTO_BED_LEVELING_GRID
463 463
 
464
-  #ifdef AUTO_BED_LEVELING_GRID
464
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
465 465
 
466 466
     #define LEFT_PROBE_BED_POSITION 15
467 467
     #define RIGHT_PROBE_BED_POSITION 170
@@ -518,7 +518,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
518 518
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
519 519
                           // - Block Z homing only when the probe is outside bed area.
520 520
 
521
-  #ifdef Z_SAFE_HOMING
521
+  #if ENABLED(Z_SAFE_HOMING)
522 522
 
523 523
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
524 524
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -550,7 +550,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
550 550
 
551 551
 // Manual homing switch locations:
552 552
 // For deltabots this means top and center of the Cartesian print volume.
553
-#ifdef MANUAL_HOME_POSITIONS
553
+#if ENABLED(MANUAL_HOME_POSITIONS)
554 554
   #define MANUAL_X_HOME_POS 0
555 555
   #define MANUAL_Y_HOME_POS 0
556 556
   #define MANUAL_Z_HOME_POS 0
@@ -589,8 +589,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
589 589
 
590 590
 // Custom M code points
591 591
 #define CUSTOM_M_CODES
592
-#ifdef CUSTOM_M_CODES
593
-  #ifdef ENABLE_AUTO_BED_LEVELING
592
+#if ENABLED(CUSTOM_M_CODES)
593
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
594 594
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
595 595
     #define Z_PROBE_OFFSET_RANGE_MIN -20
596 596
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -607,7 +607,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
607 607
 //define this to enable EEPROM support
608 608
 //#define EEPROM_SETTINGS
609 609
 
610
-#ifdef EEPROM_SETTINGS
610
+#if ENABLED(EEPROM_SETTINGS)
611 611
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
612 612
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
613 613
 #endif
@@ -791,7 +791,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
791 791
 // With this option servos are powered only during movement, then turned off to prevent jitter.
792 792
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
793 793
 
794
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
794
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
795 795
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
796 796
   // 300ms is a good value but you can try less delay.
797 797
   // If the servo can't reach the requested position, increase it.

+ 16
- 16
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated:
248 248
 
249 249
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
250 250
 
251
-#ifdef PIDTEMPBED
251
+#if ENABLED(PIDTEMPBED)
252 252
 
253 253
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
254 254
 
@@ -316,7 +316,7 @@ Here are some standard links for getting your machine calibrated:
316 316
 // Enable DELTA kinematics and most of the default configuration for Deltas
317 317
 #define DELTA
318 318
 
319
-#ifdef DELTA
319
+#if ENABLED(DELTA)
320 320
 
321 321
   // Make delta curves from many straight lines (linear interpolation).
322 322
   // This is a trade-off between visible corners (not enough segments)
@@ -443,7 +443,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
443 443
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
444 444
                                  // It is assumed that when logic high = filament available
445 445
                                  //                    when logic  low = filament ran out
446
-#ifdef FILAMENT_RUNOUT_SENSOR
446
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
447 447
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
448 448
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
449 449
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -456,11 +456,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
456 456
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
457 457
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
458 458
 
459
-#ifdef MANUAL_BED_LEVELING
459
+#if ENABLED(MANUAL_BED_LEVELING)
460 460
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
461 461
 #endif  // MANUAL_BED_LEVELING
462 462
 
463
-#ifdef MESH_BED_LEVELING
463
+#if ENABLED(MESH_BED_LEVELING)
464 464
   #define MESH_MIN_X 10
465 465
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
466 466
   #define MESH_MIN_Y 10
@@ -479,7 +479,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
479 479
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
480 480
 //#define Z_PROBE_REPEATABILITY_TEST // Z-Probe Repeatability test is not supported in Deltas yet.
481 481
 
482
-#ifdef ENABLE_AUTO_BED_LEVELING
482
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
483 483
 
484 484
   // There are 2 different ways to specify probing locations
485 485
   //
@@ -496,7 +496,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
496 496
   // Note: this feature generates 10KB extra code size
497 497
   #define AUTO_BED_LEVELING_GRID  // Deltas only support grid mode
498 498
 
499
-  #ifdef AUTO_BED_LEVELING_GRID
499
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
500 500
 
501 501
     // set the rectangle in which to probe
502 502
     #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
@@ -551,7 +551,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
551 551
   // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
552 552
   //#define Z_PROBE_ALLEN_KEY
553 553
 
554
-  #ifdef Z_PROBE_ALLEN_KEY
554
+  #if ENABLED(Z_PROBE_ALLEN_KEY)
555 555
     // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
556 556
     // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
557 557
 
@@ -638,7 +638,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
638 638
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
639 639
                           // - Block Z homing only when the probe is outside bed area.
640 640
 
641
-  #ifdef Z_SAFE_HOMING
641
+  #if ENABLED(Z_SAFE_HOMING)
642 642
 
643 643
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
644 644
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -670,7 +670,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
670 670
 
671 671
 // Manual homing switch locations:
672 672
 // For deltabots this means top and center of the Cartesian print volume.
673
-#ifdef MANUAL_HOME_POSITIONS
673
+#if ENABLED(MANUAL_HOME_POSITIONS)
674 674
   #define MANUAL_X_HOME_POS 0
675 675
   #define MANUAL_Y_HOME_POS 0
676 676
   #define MANUAL_Z_HOME_POS 405 // For delta: Distance between nozzle and print surface after homing.
@@ -709,8 +709,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
709 709
 
710 710
 // Custom M code points
711 711
 #define CUSTOM_M_CODES
712
-#ifdef CUSTOM_M_CODES
713
-  #ifdef ENABLE_AUTO_BED_LEVELING
712
+#if ENABLED(CUSTOM_M_CODES)
713
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
714 714
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
715 715
     #define Z_PROBE_OFFSET_RANGE_MIN -20
716 716
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -727,7 +727,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
727 727
 //define this to enable EEPROM support
728 728
 //#define EEPROM_SETTINGS
729 729
 
730
-#ifdef EEPROM_SETTINGS
730
+#if ENABLED(EEPROM_SETTINGS)
731 731
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
732 732
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
733 733
 #endif
@@ -914,7 +914,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
914 914
 // With this option servos are powered only during movement, then turned off to prevent jitter.
915 915
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
916 916
 
917
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
917
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
918 918
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
919 919
   // 300ms is a good value but you can try less delay.
920 920
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 120   // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -298,7 +298,7 @@
298 298
 
299 299
 // @section lcd
300 300
 
301
-#ifdef SDSUPPORT
301
+#if ENABLED(SDSUPPORT)
302 302
 
303 303
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
304 304
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -317,7 +317,7 @@
317 317
   // Show a progress bar on HD44780 LCDs for SD printing
318 318
   //#define LCD_PROGRESS_BAR
319 319
 
320
-  #ifdef LCD_PROGRESS_BAR
320
+  #if ENABLED(LCD_PROGRESS_BAR)
321 321
     // Amount of time (ms) to show the bar
322 322
     #define PROGRESS_BAR_BAR_TIME 2000
323 323
     // Amount of time (ms) to show the status message
@@ -340,7 +340,7 @@
340 340
 #endif // SDSUPPORT
341 341
 
342 342
 // for dogm lcd displays you can choose some additional fonts:
343
-#ifdef DOGLCD
343
+#if ENABLED(DOGLCD)
344 344
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
345 345
   // we don't have a big font for Cyrillic, Kana
346 346
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 2.85
391 391
   #define STEPS_MM_E 836
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 5               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 16
- 16
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated:
248 248
 
249 249
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
250 250
 
251
-#ifdef PIDTEMPBED
251
+#if ENABLED(PIDTEMPBED)
252 252
 
253 253
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
254 254
 
@@ -316,7 +316,7 @@ Here are some standard links for getting your machine calibrated:
316 316
 // Enable DELTA kinematics and most of the default configuration for Deltas
317 317
 #define DELTA
318 318
 
319
-#ifdef DELTA
319
+#if ENABLED(DELTA)
320 320
 
321 321
   // Make delta curves from many straight lines (linear interpolation).
322 322
   // This is a trade-off between visible corners (not enough segments)
@@ -443,7 +443,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
443 443
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
444 444
                                  // It is assumed that when logic high = filament available
445 445
                                  //                    when logic  low = filament ran out
446
-#ifdef FILAMENT_RUNOUT_SENSOR
446
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
447 447
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
448 448
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
449 449
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -456,11 +456,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
456 456
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
457 457
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
458 458
 
459
-#ifdef MANUAL_BED_LEVELING
459
+#if ENABLED(MANUAL_BED_LEVELING)
460 460
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
461 461
 #endif  // MANUAL_BED_LEVELING
462 462
 
463
-#ifdef MESH_BED_LEVELING
463
+#if ENABLED(MESH_BED_LEVELING)
464 464
   #define MESH_MIN_X 10
465 465
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
466 466
   #define MESH_MIN_Y 10
@@ -479,7 +479,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
479 479
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
480 480
 //#define Z_PROBE_REPEATABILITY_TEST // Z-Probe Repeatability test is not supported in Deltas yet.
481 481
 
482
-#ifdef ENABLE_AUTO_BED_LEVELING
482
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
483 483
 
484 484
   // There are 2 different ways to specify probing locations
485 485
   //
@@ -496,7 +496,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
496 496
   // Note: this feature generates 10KB extra code size
497 497
   #define AUTO_BED_LEVELING_GRID  // Deltas only support grid mode
498 498
 
499
-  #ifdef AUTO_BED_LEVELING_GRID
499
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
500 500
 
501 501
     // set the rectangle in which to probe
502 502
     #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
@@ -551,7 +551,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
551 551
   // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
552 552
   //#define Z_PROBE_ALLEN_KEY
553 553
 
554
-  #ifdef Z_PROBE_ALLEN_KEY
554
+  #if ENABLED(Z_PROBE_ALLEN_KEY)
555 555
     // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
556 556
     // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
557 557
 
@@ -638,7 +638,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
638 638
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
639 639
                           // - Block Z homing only when the probe is outside bed area.
640 640
 
641
-  #ifdef Z_SAFE_HOMING
641
+  #if ENABLED(Z_SAFE_HOMING)
642 642
 
643 643
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
644 644
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -670,7 +670,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
670 670
 
671 671
 // Manual homing switch locations:
672 672
 // For deltabots this means top and center of the Cartesian print volume.
673
-#ifdef MANUAL_HOME_POSITIONS
673
+#if ENABLED(MANUAL_HOME_POSITIONS)
674 674
   #define MANUAL_X_HOME_POS 0
675 675
   #define MANUAL_Y_HOME_POS 0
676 676
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
@@ -709,8 +709,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
709 709
 
710 710
 // Custom M code points
711 711
 #define CUSTOM_M_CODES
712
-#ifdef CUSTOM_M_CODES
713
-  #ifdef ENABLE_AUTO_BED_LEVELING
712
+#if ENABLED(CUSTOM_M_CODES)
713
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
714 714
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
715 715
     #define Z_PROBE_OFFSET_RANGE_MIN -20
716 716
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -727,7 +727,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
727 727
 //define this to enable EEPROM support
728 728
 //#define EEPROM_SETTINGS
729 729
 
730
-#ifdef EEPROM_SETTINGS
730
+#if ENABLED(EEPROM_SETTINGS)
731 731
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
732 732
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
733 733
 #endif
@@ -918,7 +918,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
918 918
 // With this option servos are powered only during movement, then turned off to prevent jitter.
919 919
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
920 920
 
921
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
921
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
922 922
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
923 923
   // 300ms is a good value but you can try less delay.
924 924
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -298,7 +298,7 @@
298 298
 
299 299
 // @section lcd
300 300
 
301
-#ifdef SDSUPPORT
301
+#if ENABLED(SDSUPPORT)
302 302
 
303 303
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
304 304
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -317,7 +317,7 @@
317 317
   // Show a progress bar on HD44780 LCDs for SD printing
318 318
   //#define LCD_PROGRESS_BAR
319 319
 
320
-  #ifdef LCD_PROGRESS_BAR
320
+  #if ENABLED(LCD_PROGRESS_BAR)
321 321
     // Amount of time (ms) to show the bar
322 322
     #define PROGRESS_BAR_BAR_TIME 2000
323 323
     // Amount of time (ms) to show the status message
@@ -340,7 +340,7 @@
340 340
 #endif // SDSUPPORT
341 341
 
342 342
 // for dogm lcd displays you can choose some additional fonts:
343
-#ifdef DOGLCD
343
+#if ENABLED(DOGLCD)
344 344
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
345 345
   // we don't have a big font for Cyrillic, Kana
346 346
   //#define USE_BIG_EDIT_FONT
@@ -356,7 +356,7 @@
356 356
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
357 357
 //#define USE_WATCHDOG
358 358
 
359
-#ifdef USE_WATCHDOG
359
+#if ENABLED(USE_WATCHDOG)
360 360
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
361 361
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
362 362
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -369,7 +369,7 @@
369 369
 // it can e.g. be used to change z-positions in the print startup phase in real-time
370 370
 // does not respect endstops!
371 371
 //#define BABYSTEPPING
372
-#ifdef BABYSTEPPING
372
+#if ENABLED(BABYSTEPPING)
373 373
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
374 374
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 375
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -386,7 +386,7 @@
386 386
 // so: v ^ 2 is proportional to number of steps we advance the extruder
387 387
 //#define ADVANCE
388 388
 
389
-#ifdef ADVANCE
389
+#if ENABLED(ADVANCE)
390 390
   #define EXTRUDER_ADVANCE_K .0
391 391
   #define D_FILAMENT 2.85
392 392
   #define STEPS_MM_E 836
@@ -413,7 +413,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
413 413
 
414 414
 // The number of linear motions that can be in the plan at any give time.
415 415
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
416
-#ifdef SDSUPPORT
416
+#if ENABLED(SDSUPPORT)
417 417
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
418 418
 #else
419 419
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -443,7 +443,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
443 443
 // the moves are than replaced by the firmware controlled ones.
444 444
 
445 445
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
446
-#ifdef FWRETRACT
446
+#if ENABLED(FWRETRACT)
447 447
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
448 448
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
449 449
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -455,9 +455,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
455 455
 #endif
456 456
 
457 457
 // Add support for experimental filament exchange support M600; requires display
458
-#ifdef ULTIPANEL
458
+#if ENABLED(ULTIPANEL)
459 459
   //#define FILAMENTCHANGEENABLE
460
-  #ifdef FILAMENTCHANGEENABLE
460
+  #if ENABLED(FILAMENTCHANGEENABLE)
461 461
     #define FILAMENTCHANGE_XPOS 3
462 462
     #define FILAMENTCHANGE_YPOS 3
463 463
     #define FILAMENTCHANGE_ZADD 10
@@ -474,7 +474,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
474 474
 // @section tmc
475 475
 
476 476
 //#define HAVE_TMCDRIVER
477
-#ifdef HAVE_TMCDRIVER
477
+#if ENABLED(HAVE_TMCDRIVER)
478 478
 
479 479
 //  #define X_IS_TMC
480 480
   #define X_MAX_CURRENT 1000  //in mA
@@ -536,7 +536,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
536 536
 // @section l6470
537 537
 
538 538
 //#define HAVE_L6470DRIVER
539
-#ifdef HAVE_L6470DRIVER
539
+#if ENABLED(HAVE_L6470DRIVER)
540 540
 
541 541
 //  #define X_IS_L6470
542 542
   #define X_MICROSTEPS 16     //number of microsteps

+ 16
- 16
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated:
248 248
 
249 249
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
250 250
 
251
-#ifdef PIDTEMPBED
251
+#if ENABLED(PIDTEMPBED)
252 252
 
253 253
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
254 254
 
@@ -316,7 +316,7 @@ Here are some standard links for getting your machine calibrated:
316 316
 // Enable DELTA kinematics and most of the default configuration for Deltas
317 317
 #define DELTA
318 318
 
319
-#ifdef DELTA
319
+#if ENABLED(DELTA)
320 320
 
321 321
   // Make delta curves from many straight lines (linear interpolation).
322 322
   // This is a trade-off between visible corners (not enough segments)
@@ -443,7 +443,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
443 443
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
444 444
                                  // It is assumed that when logic high = filament available
445 445
                                  //                    when logic  low = filament ran out
446
-#ifdef FILAMENT_RUNOUT_SENSOR
446
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
447 447
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
448 448
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
449 449
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -456,11 +456,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
456 456
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
457 457
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
458 458
 
459
-#ifdef MANUAL_BED_LEVELING
459
+#if ENABLED(MANUAL_BED_LEVELING)
460 460
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
461 461
 #endif  // MANUAL_BED_LEVELING
462 462
 
463
-#ifdef MESH_BED_LEVELING
463
+#if ENABLED(MESH_BED_LEVELING)
464 464
   #define MESH_MIN_X 10
465 465
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
466 466
   #define MESH_MIN_Y 10
@@ -479,7 +479,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
479 479
 #define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
480 480
 //#define Z_PROBE_REPEATABILITY_TEST // Z-Probe Repeatability test is not supported in Deltas yet.
481 481
 
482
-#ifdef ENABLE_AUTO_BED_LEVELING
482
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
483 483
 
484 484
   // There are 2 different ways to specify probing locations
485 485
   //
@@ -496,7 +496,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
496 496
   // Note: this feature generates 10KB extra code size
497 497
   #define AUTO_BED_LEVELING_GRID  // Deltas only support grid mode
498 498
 
499
-  #ifdef AUTO_BED_LEVELING_GRID
499
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
500 500
 
501 501
     // set the rectangle in which to probe
502 502
     #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
@@ -551,7 +551,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
551 551
   // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
552 552
   #define Z_PROBE_ALLEN_KEY
553 553
 
554
-  #ifdef Z_PROBE_ALLEN_KEY
554
+  #if ENABLED(Z_PROBE_ALLEN_KEY)
555 555
     // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
556 556
     // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
557 557
 
@@ -642,7 +642,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
642 642
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
643 643
                           // - Block Z homing only when the probe is outside bed area.
644 644
 
645
-  #ifdef Z_SAFE_HOMING
645
+  #if ENABLED(Z_SAFE_HOMING)
646 646
 
647 647
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
648 648
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -674,7 +674,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
674 674
 
675 675
 // Manual homing switch locations:
676 676
 // For deltabots this means top and center of the Cartesian print volume.
677
-#ifdef MANUAL_HOME_POSITIONS
677
+#if ENABLED(MANUAL_HOME_POSITIONS)
678 678
   #define MANUAL_X_HOME_POS 0
679 679
   #define MANUAL_Y_HOME_POS 0
680 680
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
@@ -713,8 +713,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
713 713
 
714 714
 // Custom M code points
715 715
 #define CUSTOM_M_CODES
716
-#ifdef CUSTOM_M_CODES
717
-  #ifdef ENABLE_AUTO_BED_LEVELING
716
+#if ENABLED(CUSTOM_M_CODES)
717
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
718 718
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
719 719
     #define Z_PROBE_OFFSET_RANGE_MIN -20
720 720
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -731,7 +731,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
731 731
 //define this to enable EEPROM support
732 732
 //#define EEPROM_SETTINGS
733 733
 
734
-#ifdef EEPROM_SETTINGS
734
+#if ENABLED(EEPROM_SETTINGS)
735 735
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
736 736
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
737 737
 #endif
@@ -918,7 +918,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
918 918
 // With this option servos are powered only during movement, then turned off to prevent jitter.
919 919
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
920 920
 
921
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
921
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
922 922
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
923 923
   // 300ms is a good value but you can try less delay.
924 924
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 2.85
391 391
   #define STEPS_MM_E 836
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 16
- 16
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -42,7 +42,7 @@ Here are some standard links for getting your machine calibrated:
42 42
 
43 43
 // @section info
44 44
 
45
-#ifdef HAS_AUTOMATIC_VERSIONING
45
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
46 46
   #include "_Version.h"
47 47
 #else
48 48
   #include "Default_Version.h"
@@ -199,7 +199,7 @@ Here are some standard links for getting your machine calibrated:
199 199
 #define PIDTEMP
200 200
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
201 201
 #define PID_MAX  125 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
202
-#ifdef PIDTEMP
202
+#if ENABLED(PIDTEMP)
203 203
   //#define PID_DEBUG // Sends debug data to the serial port.
204 204
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
205 205
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -241,7 +241,7 @@ Here are some standard links for getting your machine calibrated:
241 241
 
242 242
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
243 243
 
244
-#ifdef PIDTEMPBED
244
+#if ENABLED(PIDTEMPBED)
245 245
 
246 246
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
247 247
 
@@ -303,7 +303,7 @@ Here are some standard links for getting your machine calibrated:
303 303
 // Enable DELTA kinematics and most of the default configuration for Deltas
304 304
 #define DELTA
305 305
 
306
-#ifdef DELTA
306
+#if ENABLED(DELTA)
307 307
 
308 308
   // Make delta curves from many straight lines (linear interpolation).
309 309
   // This is a trade-off between visible corners (not enough segments)
@@ -430,7 +430,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
430 430
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
431 431
                                  // It is assumed that when logic high = filament available
432 432
                                  //                    when logic  low = filament ran out
433
-#ifdef FILAMENT_RUNOUT_SENSOR
433
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
434 434
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
435 435
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
436 436
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -443,11 +443,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
443 443
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
444 444
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
445 445
 
446
-#ifdef MANUAL_BED_LEVELING
446
+#if ENABLED(MANUAL_BED_LEVELING)
447 447
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
448 448
 #endif  // MANUAL_BED_LEVELING
449 449
 
450
-#ifdef MESH_BED_LEVELING
450
+#if ENABLED(MESH_BED_LEVELING)
451 451
   #define MESH_MIN_X 10
452 452
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
453 453
   #define MESH_MIN_Y 10
@@ -466,7 +466,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
466 466
 #define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
467 467
 //#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
468 468
 
469
-#ifdef ENABLE_AUTO_BED_LEVELING
469
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
470 470
 
471 471
   // There are 2 different ways to specify probing locations
472 472
   //
@@ -483,7 +483,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
483 483
   // Note: this feature generates 10KB extra code size
484 484
   #define AUTO_BED_LEVELING_GRID  // Deltas only support grid mode
485 485
 
486
-  #ifdef AUTO_BED_LEVELING_GRID
486
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
487 487
 
488 488
     // set the rectangle in which to probe
489 489
     #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS-25)
@@ -540,7 +540,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
540 540
   // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
541 541
   #define Z_PROBE_ALLEN_KEY
542 542
 
543
-  #ifdef Z_PROBE_ALLEN_KEY
543
+  #if ENABLED(Z_PROBE_ALLEN_KEY)
544 544
     // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
545 545
     // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
546 546
 
@@ -627,7 +627,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
627 627
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
628 628
                           // - Block Z homing only when the probe is outside bed area.
629 629
 
630
-  #ifdef Z_SAFE_HOMING
630
+  #if ENABLED(Z_SAFE_HOMING)
631 631
 
632 632
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
633 633
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -659,7 +659,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
659 659
 
660 660
 // Manual homing switch locations:
661 661
 // For deltabots this means top and center of the Cartesian print volume.
662
-#ifdef MANUAL_HOME_POSITIONS
662
+#if ENABLED(MANUAL_HOME_POSITIONS)
663 663
   #define MANUAL_X_HOME_POS 0
664 664
   #define MANUAL_Y_HOME_POS 0
665 665
   #define MANUAL_Z_HOME_POS 277 // For delta: Distance between nozzle and print surface after homing.
@@ -708,8 +708,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
708 708
 
709 709
 // Custom M code points
710 710
 #define CUSTOM_M_CODES
711
-#ifdef CUSTOM_M_CODES
712
-  #ifdef ENABLE_AUTO_BED_LEVELING
711
+#if ENABLED(CUSTOM_M_CODES)
712
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
713 713
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
714 714
     #define Z_PROBE_OFFSET_RANGE_MIN -15
715 715
     #define Z_PROBE_OFFSET_RANGE_MAX -5
@@ -726,7 +726,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
726 726
 //define this to enable EEPROM support
727 727
 //#define EEPROM_SETTINGS
728 728
 
729
-#ifdef EEPROM_SETTINGS
729
+#if ENABLED(EEPROM_SETTINGS)
730 730
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
731 731
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
732 732
 #endif
@@ -913,7 +913,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
913 913
 // With this option servos are powered only during movement, then turned off to prevent jitter.
914 914
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
915 915
 
916
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
916
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
917 917
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
918 918
   // 300ms is a good value but you can try less delay.
919 919
   // If the servo can't reach the requested position, increase it.

+ 32
- 32
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -13,7 +13,7 @@
13 13
 //=============================Thermal Settings  ============================
14 14
 //===========================================================================
15 15
 
16
-#ifdef BED_LIMIT_SWITCHING
16
+#if ENABLED(BED_LIMIT_SWITCHING)
17 17
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
18 18
 #endif
19 19
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -21,7 +21,7 @@
21 21
 /**
22 22
  * Thermal Protection parameters
23 23
  */
24
-#ifdef THERMAL_PROTECTION_HOTENDS
24
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
25 25
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
26 26
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
27 27
 
@@ -35,16 +35,16 @@
35 35
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
36 36
 #endif
37 37
 
38
-#ifdef THERMAL_PROTECTION_BED
38
+#if ENABLED(THERMAL_PROTECTION_BED)
39 39
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
40 40
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
41 41
 #endif
42 42
 
43
-#ifdef PIDTEMP
43
+#if ENABLED(PIDTEMP)
44 44
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
45 45
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
46 46
   #define PID_ADD_EXTRUSION_RATE
47
-  #ifdef PID_ADD_EXTRUSION_RATE
47
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
48 48
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
49 49
   #endif
50 50
 #endif
@@ -60,7 +60,7 @@
60 60
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
61 61
  */
62 62
 #define AUTOTEMP
63
-#ifdef AUTOTEMP
63
+#if ENABLED(AUTOTEMP)
64 64
   #define AUTOTEMP_OLDWEIGHT 0.98
65 65
 #endif
66 66
 
@@ -130,20 +130,20 @@
130 130
 
131 131
 //// AUTOSET LOCATIONS OF LIMIT SWITCHES
132 132
 //// Added by ZetaPhoenix 09-15-2012
133
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
133
+#if ENABLED(MANUAL_HOME_POSITIONS)  // Use manual limit switch locations
134 134
   #define X_HOME_POS MANUAL_X_HOME_POS
135 135
   #define Y_HOME_POS MANUAL_Y_HOME_POS
136 136
   #define Z_HOME_POS MANUAL_Z_HOME_POS
137 137
 #else //Set min/max homing switch positions based upon homing direction and min/max travel limits
138 138
   //X axis
139 139
   #if X_HOME_DIR == -1
140
-    #ifdef BED_CENTER_AT_0_0
140
+    #if ENABLED(BED_CENTER_AT_0_0)
141 141
       #define X_HOME_POS X_MAX_LENGTH * -0.5
142 142
     #else
143 143
       #define X_HOME_POS X_MIN_POS
144 144
     #endif //BED_CENTER_AT_0_0
145 145
   #else
146
-    #ifdef BED_CENTER_AT_0_0
146
+    #if ENABLED(BED_CENTER_AT_0_0)
147 147
       #define X_HOME_POS X_MAX_LENGTH * 0.5
148 148
     #else
149 149
       #define X_HOME_POS X_MAX_POS
@@ -152,13 +152,13 @@
152 152
 
153 153
   //Y axis
154 154
   #if Y_HOME_DIR == -1
155
-    #ifdef BED_CENTER_AT_0_0
155
+    #if ENABLED(BED_CENTER_AT_0_0)
156 156
       #define Y_HOME_POS Y_MAX_LENGTH * -0.5
157 157
     #else
158 158
       #define Y_HOME_POS Y_MIN_POS
159 159
     #endif //BED_CENTER_AT_0_0
160 160
   #else
161
-    #ifdef BED_CENTER_AT_0_0
161
+    #if ENABLED(BED_CENTER_AT_0_0)
162 162
       #define Y_HOME_POS Y_MAX_LENGTH * 0.5
163 163
     #else
164 164
       #define Y_HOME_POS Y_MAX_POS
@@ -184,7 +184,7 @@
184 184
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
185 185
 //#define Z_DUAL_STEPPER_DRIVERS
186 186
 
187
-#ifdef Z_DUAL_STEPPER_DRIVERS
187
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
188 188
   #undef EXTRUDERS
189 189
   #define EXTRUDERS 1
190 190
 #endif
@@ -195,7 +195,7 @@
195 195
 // Define if the two Y drives need to rotate in opposite directions
196 196
 #define INVERT_Y2_VS_Y_DIR true
197 197
 
198
-#ifdef Y_DUAL_STEPPER_DRIVERS
198
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
199 199
   #undef EXTRUDERS
200 200
   #define EXTRUDERS 1
201 201
 #endif
@@ -209,7 +209,7 @@
209 209
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
210 210
 // allowing faster printing speeds.
211 211
 //#define DUAL_X_CARRIAGE
212
-#ifdef DUAL_X_CARRIAGE
212
+#if ENABLED(DUAL_X_CARRIAGE)
213 213
   // Configuration for second X-carriage
214 214
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
215 215
   // the second x-carriage always homes to the maximum endstop.
@@ -266,7 +266,7 @@
266 266
 
267 267
 // @section machine
268 268
 
269
-#ifdef CONFIG_STEPPERS_TOSHIBA
269
+#if ENABLED(CONFIG_STEPPERS_TOSHIBA)
270 270
 #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
271 271
 #else
272 272
 #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
@@ -285,7 +285,7 @@
285 285
 
286 286
 // @section lcd
287 287
 
288
-#ifdef ULTIPANEL
288
+#if ENABLED(ULTIPANEL)
289 289
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
290 290
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
291 291
 #endif
@@ -338,7 +338,7 @@
338 338
 
339 339
 // @section lcd
340 340
 
341
-#ifdef SDSUPPORT
341
+#if ENABLED(SDSUPPORT)
342 342
 
343 343
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
344 344
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -357,7 +357,7 @@
357 357
   // Show a progress bar on HD44780 LCDs for SD printing
358 358
   //#define LCD_PROGRESS_BAR
359 359
 
360
-  #ifdef LCD_PROGRESS_BAR
360
+  #if ENABLED(LCD_PROGRESS_BAR)
361 361
     // Amount of time (ms) to show the bar
362 362
     #define PROGRESS_BAR_BAR_TIME 2000
363 363
     // Amount of time (ms) to show the status message
@@ -380,7 +380,7 @@
380 380
 #endif // SDSUPPORT
381 381
 
382 382
 // for dogm lcd displays you can choose some additional fonts:
383
-#ifdef DOGLCD
383
+#if ENABLED(DOGLCD)
384 384
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
385 385
   // we don't have a big font for Cyrillic, Kana
386 386
   //#define USE_BIG_EDIT_FONT
@@ -395,7 +395,7 @@
395 395
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
396 396
 //#define USE_WATCHDOG
397 397
 
398
-#ifdef USE_WATCHDOG
398
+#if ENABLED(USE_WATCHDOG)
399 399
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
400 400
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
401 401
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -408,18 +408,18 @@
408 408
 // it can e.g. be used to change z-positions in the print startup phase in real-time
409 409
 // does not respect endstops!
410 410
 //#define BABYSTEPPING
411
-#ifdef BABYSTEPPING
411
+#if ENABLED(BABYSTEPPING)
412 412
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
413 413
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
414 414
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
415 415
 
416 416
 // @section extruder
417
-  #ifdef COREXY
417
+  #if ENABLED(COREXY)
418 418
     #error BABYSTEPPING not implemented for COREXY yet.
419 419
   #endif
420 420
 
421
-  #ifdef DELTA
422
-    #ifdef BABYSTEP_XY
421
+  #if ENABLED(DELTA)
422
+    #if ENABLED(BABYSTEP_XY)
423 423
       #error BABYSTEPPING only implemented for Z axis on deltabots.
424 424
     #endif
425 425
   #endif
@@ -434,7 +434,7 @@
434 434
 // so: v ^ 2 is proportional to number of steps we advance the extruder
435 435
 //#define ADVANCE
436 436
 
437
-#ifdef ADVANCE
437
+#if ENABLED(ADVANCE)
438 438
   #define EXTRUDER_ADVANCE_K .0
439 439
 
440 440
   #define D_FILAMENT 2.85
@@ -451,7 +451,7 @@
451 451
 
452 452
 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
453 453
 
454
-#ifdef ULTIPANEL
454
+#if ENABLED(ULTIPANEL)
455 455
  #undef SDCARDDETECTINVERTED
456 456
 #endif
457 457
 
@@ -512,7 +512,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
512 512
 // the moves are than replaced by the firmware controlled ones.
513 513
 
514 514
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
515
-#ifdef FWRETRACT
515
+#if ENABLED(FWRETRACT)
516 516
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
517 517
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
518 518
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -524,9 +524,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
524 524
 #endif
525 525
 
526 526
 // Add support for experimental filament exchange support M600; requires display
527
-#ifdef ULTIPANEL
527
+#if ENABLED(ULTIPANEL)
528 528
   #define FILAMENTCHANGEENABLE
529
-  #ifdef FILAMENTCHANGEENABLE
529
+  #if ENABLED(FILAMENTCHANGEENABLE)
530 530
     #define FILAMENTCHANGE_XPOS 3
531 531
     #define FILAMENTCHANGE_YPOS 3
532 532
     #define FILAMENTCHANGE_ZADD 10
@@ -543,7 +543,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
543 543
 // @section tmc
544 544
 
545 545
 //#define HAVE_TMCDRIVER
546
-#ifdef HAVE_TMCDRIVER
546
+#if ENABLED(HAVE_TMCDRIVER)
547 547
 
548 548
 //  #define X_IS_TMC
549 549
   #define X_MAX_CURRENT 1000  //in mA
@@ -597,8 +597,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st
597 597
 
598 598
 #endif
599 599
 
600
-#ifdef FILAMENTCHANGEENABLE
601
-  #ifdef EXTRUDER_RUNOUT_PREVENT
600
+#if ENABLED(FILAMENTCHANGEENABLE)
601
+  #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
602 602
     #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
603 603
   #endif
604 604
 #endif

+ 14
- 14
Marlin/example_configurations/makibox/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -251,7 +251,7 @@ Here are some standard links for getting your machine calibrated:
251 251
 
252 252
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
253 253
 
254
-#ifdef PIDTEMPBED
254
+#if ENABLED(PIDTEMPBED)
255 255
 
256 256
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
257 257
 
@@ -411,7 +411,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
411 411
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
412 412
                                  // It is assumed that when logic high = filament available
413 413
                                  //                    when logic  low = filament ran out
414
-#ifdef FILAMENT_RUNOUT_SENSOR
414
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
415 415
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
416 416
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
417 417
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -424,11 +424,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
424 424
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
425 425
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
426 426
 
427
-#ifdef MANUAL_BED_LEVELING
427
+#if ENABLED(MANUAL_BED_LEVELING)
428 428
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
429 429
 #endif  // MANUAL_BED_LEVELING
430 430
 
431
-#ifdef MESH_BED_LEVELING
431
+#if ENABLED(MESH_BED_LEVELING)
432 432
   #define MESH_MIN_X 10
433 433
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
434 434
   #define MESH_MIN_Y 10
@@ -447,7 +447,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
447 447
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
448 448
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
449 449
 
450
-#ifdef ENABLE_AUTO_BED_LEVELING
450
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
451 451
 
452 452
   // There are 2 different ways to specify probing locations
453 453
   //
@@ -464,7 +464,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
464 464
   // Note: this feature generates 10KB extra code size
465 465
   #define AUTO_BED_LEVELING_GRID
466 466
 
467
-  #ifdef AUTO_BED_LEVELING_GRID
467
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
468 468
 
469 469
     #define LEFT_PROBE_BED_POSITION 15
470 470
     #define RIGHT_PROBE_BED_POSITION 170
@@ -521,7 +521,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
521 521
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
522 522
                           // - Block Z homing only when the probe is outside bed area.
523 523
 
524
-  #ifdef Z_SAFE_HOMING
524
+  #if ENABLED(Z_SAFE_HOMING)
525 525
 
526 526
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
527 527
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -553,7 +553,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
553 553
 
554 554
 // Manual homing switch locations:
555 555
 // For deltabots this means top and center of the Cartesian print volume.
556
-#ifdef MANUAL_HOME_POSITIONS
556
+#if ENABLED(MANUAL_HOME_POSITIONS)
557 557
   #define MANUAL_X_HOME_POS 0
558 558
   #define MANUAL_Y_HOME_POS 0
559 559
   #define MANUAL_Z_HOME_POS 0
@@ -592,8 +592,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
592 592
 
593 593
 // Custom M code points
594 594
 #define CUSTOM_M_CODES
595
-#ifdef CUSTOM_M_CODES
596
-  #ifdef ENABLE_AUTO_BED_LEVELING
595
+#if ENABLED(CUSTOM_M_CODES)
596
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
597 597
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
598 598
     #define Z_PROBE_OFFSET_RANGE_MIN -20
599 599
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -610,7 +610,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
610 610
 //define this to enable EEPROM support
611 611
 #define EEPROM_SETTINGS
612 612
 
613
-#ifdef EEPROM_SETTINGS
613
+#if ENABLED(EEPROM_SETTINGS)
614 614
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
615 615
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
616 616
 #endif
@@ -794,7 +794,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
794 794
 // With this option servos are powered only during movement, then turned off to prevent jitter.
795 795
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
796 796
 
797
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
797
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
798 798
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
799 799
   // 300ms is a good value but you can try less delay.
800 800
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 2.85
391 391
   #define STEPS_MM_E 836
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

+ 14
- 14
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated:
38 38
 
39 39
 // @section info
40 40
 
41
-#ifdef HAS_AUTOMATIC_VERSIONING
41
+#if ENABLED(HAS_AUTOMATIC_VERSIONING)
42 42
   #include "_Version.h"
43 43
 #else
44 44
   #include "Default_Version.h"
@@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated:
195 195
 #define PIDTEMP
196 196
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
197 197
 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
198
-#ifdef PIDTEMP
198
+#if ENABLED(PIDTEMP)
199 199
   //#define PID_DEBUG // Sends debug data to the serial port.
200 200
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
201 201
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
@@ -238,7 +238,7 @@ Here are some standard links for getting your machine calibrated:
238 238
 
239 239
 //#define PID_BED_DEBUG // Sends debug data to the serial port.
240 240
 
241
-#ifdef PIDTEMPBED
241
+#if ENABLED(PIDTEMPBED)
242 242
 
243 243
   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
244 244
 
@@ -398,7 +398,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
398 398
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
399 399
                                  // It is assumed that when logic high = filament available
400 400
                                  //                    when logic  low = filament ran out
401
-#ifdef FILAMENT_RUNOUT_SENSOR
401
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
402 402
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
403 403
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
404 404
   #define FILAMENT_RUNOUT_SCRIPT "M600"
@@ -411,11 +411,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
411 411
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
412 412
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
413 413
 
414
-#ifdef MANUAL_BED_LEVELING
414
+#if ENABLED(MANUAL_BED_LEVELING)
415 415
   #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
416 416
 #endif  // MANUAL_BED_LEVELING
417 417
 
418
-#ifdef MESH_BED_LEVELING
418
+#if ENABLED(MESH_BED_LEVELING)
419 419
   #define MESH_MIN_X 10
420 420
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
421 421
   #define MESH_MIN_Y 10
@@ -434,7 +434,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
434 434
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
435 435
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
436 436
 
437
-#ifdef ENABLE_AUTO_BED_LEVELING
437
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
438 438
 
439 439
   // There are 2 different ways to specify probing locations
440 440
   //
@@ -451,7 +451,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
451 451
   // Note: this feature generates 10KB extra code size
452 452
   #define AUTO_BED_LEVELING_GRID
453 453
 
454
-  #ifdef AUTO_BED_LEVELING_GRID
454
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
455 455
 
456 456
     #define LEFT_PROBE_BED_POSITION 15
457 457
     #define RIGHT_PROBE_BED_POSITION 170
@@ -508,7 +508,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
508 508
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
509 509
                           // - Block Z homing only when the probe is outside bed area.
510 510
 
511
-  #ifdef Z_SAFE_HOMING
511
+  #if ENABLED(Z_SAFE_HOMING)
512 512
 
513 513
     #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)    // X point for Z homing when homing all axis (G28)
514 514
     #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)    // Y point for Z homing when homing all axis (G28)
@@ -540,7 +540,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
540 540
 
541 541
 // Manual homing switch locations:
542 542
 // For deltabots this means top and center of the Cartesian print volume.
543
-#ifdef MANUAL_HOME_POSITIONS
543
+#if ENABLED(MANUAL_HOME_POSITIONS)
544 544
   #define MANUAL_X_HOME_POS 0
545 545
   #define MANUAL_Y_HOME_POS 0
546 546
   #define MANUAL_Z_HOME_POS 0
@@ -583,8 +583,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
583 583
 
584 584
 // Custom M code points
585 585
 #define CUSTOM_M_CODES
586
-#ifdef CUSTOM_M_CODES
587
-  #ifdef ENABLE_AUTO_BED_LEVELING
586
+#if ENABLED(CUSTOM_M_CODES)
587
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
588 588
     #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
589 589
     #define Z_PROBE_OFFSET_RANGE_MIN -20
590 590
     #define Z_PROBE_OFFSET_RANGE_MAX 20
@@ -601,7 +601,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
601 601
 //define this to enable EEPROM support
602 602
 //#define EEPROM_SETTINGS
603 603
 
604
-#ifdef EEPROM_SETTINGS
604
+#if ENABLED(EEPROM_SETTINGS)
605 605
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
606 606
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
607 607
 #endif
@@ -785,7 +785,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
785 785
 // With this option servos are powered only during movement, then turned off to prevent jitter.
786 786
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
787 787
 
788
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
788
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
789 789
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
790 790
   // 300ms is a good value but you can try less delay.
791 791
   // If the servo can't reach the requested position, increase it.

+ 22
- 22
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -9,7 +9,7 @@
9 9
 //=============================Thermal Settings  ============================
10 10
 //===========================================================================
11 11
 
12
-#ifdef BED_LIMIT_SWITCHING
12
+#if ENABLED(BED_LIMIT_SWITCHING)
13 13
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
@@ -17,7 +17,7 @@
17 17
 /**
18 18
  * Thermal Protection parameters
19 19
  */
20
-#ifdef THERMAL_PROTECTION_HOTENDS
20
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
21 21
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22 22
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23 23
 
@@ -31,7 +31,7 @@
31 31
   #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32 32
 #endif
33 33
 
34
-#ifdef THERMAL_PROTECTION_BED
34
+#if ENABLED(THERMAL_PROTECTION_BED)
35 35
   #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36 36
   #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37 37
 #endif
@@ -46,11 +46,11 @@
46 46
  * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47 47
  * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48 48
  */
49
-#ifdef PIDTEMP
49
+#if ENABLED(PIDTEMP)
50 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52 52
   #define PID_ADD_EXTRUSION_RATE
53
-  #ifdef PID_ADD_EXTRUSION_RATE
53
+  #if ENABLED(PID_ADD_EXTRUSION_RATE)
54 54
     #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55 55
   #endif
56 56
 #endif
@@ -64,7 +64,7 @@
64 64
 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65 65
 // on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66 66
 #define AUTOTEMP
67
-#ifdef AUTOTEMP
67
+#if ENABLED(AUTOTEMP)
68 68
   #define AUTOTEMP_OLDWEIGHT 0.98
69 69
 #endif
70 70
 
@@ -141,7 +141,7 @@
141 141
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
142 142
 //#define Z_DUAL_STEPPER_DRIVERS
143 143
 
144
-#ifdef Z_DUAL_STEPPER_DRIVERS
144
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
145 145
 
146 146
   // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
147 147
   // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
@@ -158,7 +158,7 @@
158 158
 
159 159
   // #define Z_DUAL_ENDSTOPS
160 160
 
161
-  #ifdef Z_DUAL_ENDSTOPS
161
+  #if ENABLED(Z_DUAL_ENDSTOPS)
162 162
     #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
163 163
     const bool Z2_MAX_ENDSTOP_INVERTING = false;
164 164
     #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
@@ -177,7 +177,7 @@
177 177
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
178 178
 // allowing faster printing speeds.
179 179
 //#define DUAL_X_CARRIAGE
180
-#ifdef DUAL_X_CARRIAGE
180
+#if ENABLED(DUAL_X_CARRIAGE)
181 181
   // Configuration for second X-carriage
182 182
   // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
183 183
   // the second x-carriage always homes to the maximum endstop.
@@ -248,7 +248,7 @@
248 248
 
249 249
 // @section lcd
250 250
 
251
-#ifdef ULTIPANEL
251
+#if ENABLED(ULTIPANEL)
252 252
   #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
253 253
   #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
254 254
 #endif
@@ -297,7 +297,7 @@
297 297
 
298 298
 // @section lcd
299 299
 
300
-#ifdef SDSUPPORT
300
+#if ENABLED(SDSUPPORT)
301 301
 
302 302
   // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
303 303
   // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
@@ -316,7 +316,7 @@
316 316
   // Show a progress bar on HD44780 LCDs for SD printing
317 317
   //#define LCD_PROGRESS_BAR
318 318
 
319
-  #ifdef LCD_PROGRESS_BAR
319
+  #if ENABLED(LCD_PROGRESS_BAR)
320 320
     // Amount of time (ms) to show the bar
321 321
     #define PROGRESS_BAR_BAR_TIME 2000
322 322
     // Amount of time (ms) to show the status message
@@ -339,7 +339,7 @@
339 339
 #endif // SDSUPPORT
340 340
 
341 341
 // for dogm lcd displays you can choose some additional fonts:
342
-#ifdef DOGLCD
342
+#if ENABLED(DOGLCD)
343 343
   // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
344 344
   // we don't have a big font for Cyrillic, Kana
345 345
   //#define USE_BIG_EDIT_FONT
@@ -355,7 +355,7 @@
355 355
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356 356
 //#define USE_WATCHDOG
357 357
 
358
-#ifdef USE_WATCHDOG
358
+#if ENABLED(USE_WATCHDOG)
359 359
 // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360 360
 // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361 361
 //  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
@@ -368,7 +368,7 @@
368 368
 // it can e.g. be used to change z-positions in the print startup phase in real-time
369 369
 // does not respect endstops!
370 370
 //#define BABYSTEPPING
371
-#ifdef BABYSTEPPING
371
+#if ENABLED(BABYSTEPPING)
372 372
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
373 373
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
374 374
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
@@ -385,7 +385,7 @@
385 385
 // so: v ^ 2 is proportional to number of steps we advance the extruder
386 386
 //#define ADVANCE
387 387
 
388
-#ifdef ADVANCE
388
+#if ENABLED(ADVANCE)
389 389
   #define EXTRUDER_ADVANCE_K .0
390 390
   #define D_FILAMENT 2.85
391 391
   #define STEPS_MM_E 836
@@ -412,7 +412,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
412 412
 
413 413
 // The number of linear motions that can be in the plan at any give time.
414 414
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
415
-#ifdef SDSUPPORT
415
+#if ENABLED(SDSUPPORT)
416 416
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
417 417
 #else
418 418
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -442,7 +442,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
442 442
 // the moves are than replaced by the firmware controlled ones.
443 443
 
444 444
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
445
-#ifdef FWRETRACT
445
+#if ENABLED(FWRETRACT)
446 446
   #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
447 447
   #define RETRACT_LENGTH 3               //default retract length (positive mm)
448 448
   #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
@@ -454,9 +454,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
454 454
 #endif
455 455
 
456 456
 // Add support for experimental filament exchange support M600; requires display
457
-#ifdef ULTIPANEL
457
+#if ENABLED(ULTIPANEL)
458 458
   //#define FILAMENTCHANGEENABLE
459
-  #ifdef FILAMENTCHANGEENABLE
459
+  #if ENABLED(FILAMENTCHANGEENABLE)
460 460
     #define FILAMENTCHANGE_XPOS 3
461 461
     #define FILAMENTCHANGE_YPOS 3
462 462
     #define FILAMENTCHANGE_ZADD 10
@@ -473,7 +473,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
473 473
 // @section tmc
474 474
 
475 475
 //#define HAVE_TMCDRIVER
476
-#ifdef HAVE_TMCDRIVER
476
+#if ENABLED(HAVE_TMCDRIVER)
477 477
 
478 478
 //  #define X_IS_TMC
479 479
   #define X_MAX_CURRENT 1000  //in mA
@@ -535,7 +535,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
535 535
 // @section l6470
536 536
 
537 537
 //#define HAVE_L6470DRIVER
538
-#ifdef HAVE_L6470DRIVER
538
+#if ENABLED(HAVE_L6470DRIVER)
539 539
 
540 540
 //  #define X_IS_L6470
541 541
   #define X_MICROSTEPS 16     //number of microsteps

Loading…
Cancel
Save