Преглед изворни кода

Merge Overridable Options (PR#2496)

Richard Wackerbarth пре 10 година
родитељ
комит
abe9905ef8
33 измењених фајлова са 641 додато и 640 уклоњено
  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. 15
    15
      Marlin/configurator/config/Configuration.h
  6. 22
    22
      Marlin/configurator/config/Configuration_adv.h
  7. 14
    14
      Marlin/example_configurations/Felix/Configuration.h
  8. 12
    12
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  9. 22
    22
      Marlin/example_configurations/Felix/Configuration_adv.h
  10. 14
    14
      Marlin/example_configurations/Hephestos/Configuration.h
  11. 22
    22
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  12. 14
    14
      Marlin/example_configurations/K8200/Configuration.h
  13. 22
    22
      Marlin/example_configurations/K8200/Configuration_adv.h
  14. 14
    14
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  15. 14
    14
      Marlin/example_configurations/RigidBot/Configuration.h
  16. 22
    22
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  17. 14
    14
      Marlin/example_configurations/SCARA/Configuration.h
  18. 22
    22
      Marlin/example_configurations/SCARA/Configuration_adv.h
  19. 14
    14
      Marlin/example_configurations/WITBOX/Configuration.h
  20. 22
    22
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  21. 14
    14
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  22. 16
    16
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  23. 22
    22
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  24. 16
    16
      Marlin/example_configurations/delta/generic/Configuration.h
  25. 22
    22
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  26. 16
    16
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  27. 22
    22
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  28. 16
    16
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  29. 32
    32
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  30. 14
    14
      Marlin/example_configurations/makibox/Configuration.h
  31. 22
    22
      Marlin/example_configurations/makibox/Configuration_adv.h
  32. 14
    14
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  33. 22
    22
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

+ 41
- 40
Marlin/Conditionals.h Прегледај датотеку

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

+ 15
- 15
Marlin/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/Configuration_adv.h Прегледај датотеку

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

+ 36
- 36
Marlin/SanityCheck.h Прегледај датотеку

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

+ 15
- 15
Marlin/configurator/config/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/configurator/config/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/Felix/Configuration.h Прегледај датотеку

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

+ 12
- 12
Marlin/example_configurations/Felix/Configuration_DUAL.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/Felix/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/Hephestos/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/Hephestos/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/K8200/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/K8200/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/RigidBot/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/RigidBot/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/SCARA/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/SCARA/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/WITBOX/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/WITBOX/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/adafruit/ST7565/Configuration.h Прегледај датотеку

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

+ 16
- 16
Marlin/example_configurations/delta/biv2.5/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h Прегледај датотеку

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

+ 16
- 16
Marlin/example_configurations/delta/generic/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/delta/generic/Configuration_adv.h Прегледај датотеку

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

+ 16
- 16
Marlin/example_configurations/delta/kossel_mini/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Прегледај датотеку

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

+ 16
- 16
Marlin/example_configurations/delta/kossel_pro/Configuration.h Прегледај датотеку

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

+ 32
- 32
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/makibox/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/makibox/Configuration_adv.h Прегледај датотеку

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

+ 14
- 14
Marlin/example_configurations/tvrrug/Round2/Configuration.h Прегледај датотеку

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

+ 22
- 22
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h Прегледај датотеку

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

Loading…
Откажи
Сачувај