Browse Source

Merge Overridable Options - Part 12 (PR#39)

Richard Wackerbarth 9 years ago
parent
commit
c54076456b
31 changed files with 88 additions and 110 deletions
  1. 1
    1
      Marlin/Conditionals.h
  2. 3
    3
      Marlin/M100_Free_Mem_Chk.cpp
  3. 7
    7
      Marlin/Marlin_main.cpp
  4. 19
    41
      Marlin/SanityCheck.h
  5. 1
    1
      Marlin/buzzer.cpp
  6. 3
    3
      Marlin/dogm_lcd_implementation.h
  7. 1
    1
      Marlin/example_configurations/Felix/Configuration.h
  8. 2
    2
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  9. 1
    1
      Marlin/example_configurations/Hephestos/Configuration.h
  10. 1
    1
      Marlin/example_configurations/K8200/Configuration.h
  11. 1
    1
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  12. 1
    1
      Marlin/example_configurations/SCARA/Configuration.h
  13. 1
    1
      Marlin/example_configurations/WITBOX/Configuration.h
  14. 1
    1
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  15. 1
    1
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  16. 1
    1
      Marlin/example_configurations/delta/generic/Configuration.h
  17. 1
    1
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  18. 1
    1
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  19. 1
    1
      Marlin/example_configurations/makibox/Configuration.h
  20. 1
    1
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  21. 1
    1
      Marlin/pins_MEGACONTROLLER.h
  22. 1
    1
      Marlin/pins_MEGATRONICS.h
  23. 1
    1
      Marlin/pins_PRINTRBOARD.h
  24. 1
    1
      Marlin/pins_RAMPS_13.h
  25. 4
    4
      Marlin/pins_RIGIDBOARD.h
  26. 8
    8
      Marlin/pins_RUMBA.h
  27. 6
    6
      Marlin/planner.cpp
  28. 1
    1
      Marlin/servo.cpp
  29. 14
    14
      Marlin/stepper.cpp
  30. 1
    1
      Marlin/ultralcd.cpp
  31. 1
    1
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 1
- 1
Marlin/Conditionals.h View File

@@ -75,7 +75,7 @@
75 75
     #define NEWPANEL
76 76
   #endif
77 77
 
78
-  #ifdef MINIPANEL
78
+  #if ENABLED(MINIPANEL)
79 79
    #define DOGLCD
80 80
    #define SDSUPPORT
81 81
    #define ULTIPANEL

+ 3
- 3
Marlin/M100_Free_Mem_Chk.cpp View File

@@ -23,7 +23,7 @@
23 23
 
24 24
 #include "Marlin.h"
25 25
 
26
-#ifdef M100_FREE_MEMORY_WATCHER
26
+#if ENABLED(M100_FREE_MEMORY_WATCHER)
27 27
 extern void *__brkval;
28 28
 extern size_t  __heap_start, __heap_end, __flp;
29 29
 
@@ -73,7 +73,7 @@ int i, j, n;
73 73
 // the right hand column to help spotting them.
74 74
 //
75 75
 
76
-#ifdef M100_FREE_MEMORY_DUMPER			// Comment out to remove Dump sub-command
76
+#if ENABLED(M100_FREE_MEMORY_DUMPER) // Disable to remove Dump sub-command
77 77
 	if ( code_seen('D') ) {
78 78
  		ptr = (unsigned char *) __brkval;
79 79
 
@@ -163,7 +163,7 @@ int i, j, n;
163 163
 // M100 C x  Corrupts x locations in the free memory pool and reports the locations of the corruption.
164 164
 // This is useful to check the correctness of the M100 D and the M100 F commands.
165 165
 //
166
-#ifdef M100_FREE_MEMORY_CORRUPTOR
166
+#if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
167 167
 	if ( code_seen('C') ) {
168 168
 		int x;			// x gets the # of locations to corrupt within the memory pool
169 169
 		x = code_value();

+ 7
- 7
Marlin/Marlin_main.cpp View File

@@ -4900,7 +4900,7 @@ inline void gcode_M503() {
4900 4900
     LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
4901 4901
     millis_t next_tick = 0;
4902 4902
     while (!lcd_clicked()) {
4903
-      #ifndef AUTO_FILAMENT_CHANGE
4903
+      #if DISABLED(AUTO_FILAMENT_CHANGE)
4904 4904
         millis_t ms = millis();
4905 4905
         if (ms >= next_tick) {
4906 4906
           lcd_quick_feedback();
@@ -4918,7 +4918,7 @@ inline void gcode_M503() {
4918 4918
     } // while(!lcd_clicked)
4919 4919
     lcd_quick_feedback(); // click sound feedback
4920 4920
 
4921
-    #ifdef AUTO_FILAMENT_CHANGE
4921
+    #if ENABLED(AUTO_FILAMENT_CHANGE)
4922 4922
       current_position[E_AXIS] = 0;
4923 4923
       st_synchronize();
4924 4924
     #endif
@@ -5377,7 +5377,7 @@ void process_next_command() {
5377 5377
           break;
5378 5378
       #endif // ENABLE_AUTO_BED_LEVELING && Z_PROBE_REPEATABILITY_TEST
5379 5379
 
5380
-      #ifdef M100_FREE_MEMORY_WATCHER
5380
+      #if ENABLED(M100_FREE_MEMORY_WATCHER)
5381 5381
         case 100:
5382 5382
           gcode_M100();
5383 5383
           break;
@@ -6228,9 +6228,9 @@ void plan_arc(
6228 6228
 
6229 6229
     clamp_to_software_endstops(arc_target);
6230 6230
 
6231
-    #if defined(DELTA) || defined(SCARA)
6231
+    #if ENABLED(DELTA) || ENABLED(SCARA)
6232 6232
       calculate_delta(arc_target);
6233
-      #ifdef ENABLE_AUTO_BED_LEVELING
6233
+      #if ENABLED(ENABLE_AUTO_BED_LEVELING)
6234 6234
         adjust_delta(arc_target);
6235 6235
       #endif
6236 6236
       plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder);
@@ -6240,9 +6240,9 @@ void plan_arc(
6240 6240
   }
6241 6241
 
6242 6242
   // Ensure last segment arrives at target location.
6243
-  #if defined(DELTA) || defined(SCARA)
6243
+  #if ENABLED(DELTA) || ENABLED(SCARA)
6244 6244
     calculate_delta(target);
6245
-    #ifdef ENABLE_AUTO_BED_LEVELING
6245
+    #if ENABLED(ENABLE_AUTO_BED_LEVELING)
6246 6246
       adjust_delta(target);
6247 6247
     #endif
6248 6248
     plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], feed_rate, active_extruder);

+ 19
- 41
Marlin/SanityCheck.h View File

@@ -146,7 +146,7 @@
146 146
      * Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled.
147 147
      */
148 148
     #if ENABLED(Z_PROBE_ENDSTOP)
149
-      #ifndef Z_PROBE_PIN
149
+      #if !PIN_EXISTS(Z_PROBE)
150 150
         #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP.
151 151
       #endif
152 152
       #if Z_PROBE_PIN == -1
@@ -338,51 +338,29 @@
338 338
   /**
339 339
    * Warnings for old configurations
340 340
    */
341
-  #ifdef X_HOME_RETRACT_MM
342
-    #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM.
343
-  #endif
344
-
345 341
   #if WATCH_TEMP_PERIOD > 500
346 342
     #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds.
347
-  #endif
348
-
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.
351
-  #endif
352
-
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.
355
-  #endif
356
-
357
-  #ifdef PROBE_SERVO_DEACTIVATION_DELAY
358
-    #error PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY.
359
-  #endif
360
-
361
-  #if defined(COREXZ) && defined(Z_LATE_ENABLE)
343
+  #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
344
+    #error Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS.
345
+  #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
346
+    #error Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED.
347
+  #elif ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE)
362 348
     #error "Z_LATE_ENABLE can't be used with COREXZ."
363
-  #endif
364
-
365
-  #ifdef BEEPER
366
-    #error BEEPER has been replaced with BEEPER_PIN. Please update your pins definitions.
367
-  #endif
368
-
369
-  #ifdef SDCARDDETECT
349
+  #elif defined(X_HOME_RETRACT_MM)
350
+    #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM.
351
+  #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
352
+    #error PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY.
353
+  #elif defined(BEEPER)
354
+    #error BEEPER is now BEEPER_PIN. Please update your pins definitions.
355
+  #elif defined(SDCARDDETECT)
370 356
     #error SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions.
371
-  #endif
372
-
373
-  #ifdef SDCARDDETECTINVERTED
357
+  #elif defined(SDCARDDETECTINVERTED)
374 358
     #error SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration.
375
-  #endif
376
-
377
-  #ifdef BTENABLED
378
-    #error BTENABLED has been replaced with BLUETOOTH. Please update your configuration.
379
-  #endif
380
-
381
-  #ifdef CUSTOM_MENDEL_NAME
382
-    #error CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME instead
383
-  #endif
384
-
385
-  #ifdef HAS_AUTOMATIC_VERSIONING
359
+  #elif defined(BTENABLED)
360
+    #error BTENABLED is now BLUETOOTH. Please update your configuration.
361
+  #elif defined(CUSTOM_MENDEL_NAME)
362
+    #error CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration.
363
+  #elif defined(HAS_AUTOMATIC_VERSIONING)
386 364
     #error HAS_AUTOMATIC_VERSIONING deprecated - use USE_AUTOMATIC_VERSIONING instead
387 365
   #endif
388 366
 

+ 1
- 1
Marlin/buzzer.cpp View File

@@ -9,7 +9,7 @@
9 9
         lcd_buzz(duration, freq);
10 10
       #elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
11 11
         SET_OUTPUT(BEEPER_PIN);
12
-        #ifdef SPEAKER // a speaker needs a AC ore a pulsed DC
12
+        #if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC
13 13
           //tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
14 14
           unsigned int delay = 1000000 / freq / 2;
15 15
           int i = duration * freq / 1000;

+ 3
- 3
Marlin/dogm_lcd_implementation.h View File

@@ -125,10 +125,10 @@
125 125
 #elif ENABLED(U8GLIB_LM6059_AF)
126 126
   // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250)
127 127
   U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
128
-#elif defined U8GLIB_SSD1306
128
+#elif ENABLED(U8GLIB_SSD1306)
129 129
   // Generic support for SSD1306 OLED I2C LCDs
130 130
   U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);
131
-#elif defined(MINIPANEL)
131
+#elif ENABLED(MINIPANEL)
132 132
   // The MINIPanel display
133 133
   U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0);
134 134
 #else
@@ -206,7 +206,7 @@ static void lcd_implementation_init() {
206 206
     pinMode(LCD_PIN_RESET, OUTPUT);           
207 207
     digitalWrite(LCD_PIN_RESET, HIGH);
208 208
   #endif
209
-  #ifndef MINIPANEL//setContrast not working for Mini Panel
209
+  #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel
210 210
     u8g.setContrast(lcd_contrast);	
211 211
   #endif
212 212
   // FIXME: remove this workaround

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

@@ -301,7 +301,7 @@ Here are some standard links for getting your machine calibrated:
301 301
 // coarse Endstop Settings
302 302
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
303 303
 
304
-#ifndef ENDSTOPPULLUPS
304
+#if DISABLED(ENDSTOPPULLUPS)
305 305
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
306 306
   // #define ENDSTOPPULLUP_XMAX
307 307
   // #define ENDSTOPPULLUP_YMAX

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

@@ -286,7 +286,7 @@ Here are some standard links for getting your machine calibrated:
286 286
 // coarse Endstop Settings
287 287
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
288 288
 
289
-#ifndef ENDSTOPPULLUPS
289
+#if DISABLED(ENDSTOPPULLUPS)
290 290
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
291 291
   // #define ENDSTOPPULLUP_XMAX
292 292
   // #define ENDSTOPPULLUP_YMAX
@@ -727,7 +727,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
727 727
 // With this option servos are powered only during movement, then turned off to prevent jitter.
728 728
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
729 729
 
730
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
730
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
731 731
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
732 732
   // 300ms is a good value but you can try less delay.
733 733
   // If the servo can't reach the requested position, increase it.

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

@@ -311,7 +311,7 @@ Here are some standard links for getting your machine calibrated:
311 311
 // coarse Endstop Settings
312 312
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
313 313
 
314
-#ifndef ENDSTOPPULLUPS
314
+#if DISABLED(ENDSTOPPULLUPS)
315 315
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
316 316
   // #define ENDSTOPPULLUP_XMAX
317 317
   // #define ENDSTOPPULLUP_YMAX

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

@@ -307,7 +307,7 @@ Here are some standard links for getting your machine calibrated:
307 307
 // coarse Endstop Settings
308 308
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
309 309
 
310
-#ifndef ENDSTOPPULLUPS
310
+#if DISABLED(ENDSTOPPULLUPS)
311 311
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
312 312
   // #define ENDSTOPPULLUP_XMAX
313 313
   // #define ENDSTOPPULLUP_YMAX

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

@@ -319,7 +319,7 @@ Here are some standard links for getting your machine calibrated:
319 319
 // coarse Endstop Settings
320 320
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
321 321
 
322
-#ifndef ENDSTOPPULLUPS
322
+#if DISABLED(ENDSTOPPULLUPS)
323 323
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
324 324
   // #define ENDSTOPPULLUP_XMAX
325 325
   // #define ENDSTOPPULLUP_YMAX

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

@@ -327,7 +327,7 @@ Here are some standard links for getting your machine calibrated:
327 327
 // coarse Endstop Settings
328 328
 //#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
329 329
 
330
-#ifndef ENDSTOPPULLUPS
330
+#if DISABLED(ENDSTOPPULLUPS)
331 331
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
332 332
   // #define ENDSTOPPULLUP_XMAX
333 333
   // #define ENDSTOPPULLUP_YMAX

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

@@ -311,7 +311,7 @@ Here are some standard links for getting your machine calibrated:
311 311
 // coarse Endstop Settings
312 312
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
313 313
 
314
-#ifndef ENDSTOPPULLUPS
314
+#if DISABLED(ENDSTOPPULLUPS)
315 315
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
316 316
   // #define ENDSTOPPULLUP_XMAX
317 317
   // #define ENDSTOPPULLUP_YMAX

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

@@ -319,7 +319,7 @@ Here are some standard links for getting your machine calibrated:
319 319
 // coarse Endstop Settings
320 320
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
321 321
 
322
-#ifndef ENDSTOPPULLUPS
322
+#if DISABLED(ENDSTOPPULLUPS)
323 323
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
324 324
   // #define ENDSTOPPULLUP_XMAX
325 325
   // #define ENDSTOPPULLUP_YMAX

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

@@ -354,7 +354,7 @@ Here are some standard links for getting your machine calibrated:
354 354
 // coarse Endstop Settings
355 355
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
356 356
 
357
-#ifndef ENDSTOPPULLUPS
357
+#if DISABLED(ENDSTOPPULLUPS)
358 358
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
359 359
   // #define ENDSTOPPULLUP_XMAX
360 360
   // #define ENDSTOPPULLUP_YMAX

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

@@ -354,7 +354,7 @@ Here are some standard links for getting your machine calibrated:
354 354
 // coarse Endstop Settings
355 355
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
356 356
 
357
-#ifndef ENDSTOPPULLUPS
357
+#if DISABLED(ENDSTOPPULLUPS)
358 358
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
359 359
   // #define ENDSTOPPULLUP_XMAX
360 360
   // #define ENDSTOPPULLUP_YMAX

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

@@ -354,7 +354,7 @@ Here are some standard links for getting your machine calibrated:
354 354
 // coarse Endstop Settings
355 355
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
356 356
 
357
-#ifndef ENDSTOPPULLUPS
357
+#if DISABLED(ENDSTOPPULLUPS)
358 358
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
359 359
   // #define ENDSTOPPULLUP_XMAX
360 360
   // #define ENDSTOPPULLUP_YMAX

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

@@ -341,7 +341,7 @@ Here are some standard links for getting your machine calibrated:
341 341
 // coarse Endstop Settings
342 342
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
343 343
 
344
-#ifndef ENDSTOPPULLUPS
344
+#if DISABLED(ENDSTOPPULLUPS)
345 345
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
346 346
   // #define ENDSTOPPULLUP_XMAX
347 347
   // #define ENDSTOPPULLUP_YMAX

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

@@ -322,7 +322,7 @@ Here are some standard links for getting your machine calibrated:
322 322
 // coarse Endstop Settings
323 323
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
324 324
 
325
-#ifndef ENDSTOPPULLUPS
325
+#if DISABLED(ENDSTOPPULLUPS)
326 326
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
327 327
   // #define ENDSTOPPULLUP_XMAX
328 328
   // #define ENDSTOPPULLUP_YMAX

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

@@ -309,7 +309,7 @@ Here are some standard links for getting your machine calibrated:
309 309
 // coarse Endstop Settings
310 310
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
311 311
 
312
-#ifndef ENDSTOPPULLUPS
312
+#if DISABLED(ENDSTOPPULLUPS)
313 313
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
314 314
   // #define ENDSTOPPULLUP_XMAX
315 315
   // #define ENDSTOPPULLUP_YMAX

+ 1
- 1
Marlin/pins_MEGACONTROLLER.h View File

@@ -80,7 +80,7 @@
80 80
   #define TEMP_BED_PIN 1 // ANALOG NUMBERING
81 81
 #endif
82 82
 
83
-#ifdef MINIPANEL
83
+#if ENABLED(MINIPANEL)
84 84
     #define BEEPER_PIN 46
85 85
     // Pins for DOGM SPI LCD Support
86 86
     #define DOGLCD_A0  47

+ 1
- 1
Marlin/pins_MEGATRONICS.h View File

@@ -60,7 +60,7 @@
60 60
 
61 61
 #define BEEPER_PIN         33   // AUX-4
62 62
 
63
-#if defined(ULTRA_LCD) && defined(NEWPANEL)
63
+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
64 64
 
65 65
   #define LCD_PINS_RS     16
66 66
   #define LCD_PINS_ENABLE 17

+ 1
- 1
Marlin/pins_PRINTRBOARD.h View File

@@ -45,7 +45,7 @@
45 45
 #endif
46 46
 
47 47
 #define X_STOP_PIN         35
48
-#ifdef SDSUPPORT
48
+#if ENABLED(SDSUPPORT)
49 49
   #define Y_STOP_PIN       37 // Move Ystop to Estop socket
50 50
 #else
51 51
   #define Y_STOP_PIN        8 // Ystop in Ystop socket

+ 1
- 1
Marlin/pins_RAMPS_13.h View File

@@ -182,7 +182,7 @@
182 182
       #define DOGLCD_CS 29
183 183
       #define DOGLCD_A0 27
184 184
       #define LCD_PIN_BL 33
185
-    #elif defined(MINIPANEL)
185
+    #elif ENABLED(MINIPANEL)
186 186
        #define BEEPER_PIN 42
187 187
        // Pins for DOGM SPI LCD Support
188 188
        #define DOGLCD_A0  44

+ 4
- 4
Marlin/pins_RIGIDBOARD.h View File

@@ -46,7 +46,7 @@
46 46
   #undef  SD_DETECT_PIN
47 47
   #define SD_DETECT_PIN 22
48 48
 
49
-#elif defined(REPRAP_DISCOUNT_SMART_CONTROLLER)
49
+#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
50 50
 
51 51
   #undef BEEPER_PIN
52 52
   #define BEEPER_PIN -1
@@ -61,10 +61,10 @@
61 61
 
62 62
 // SPI for Max6675 Thermocouple
63 63
 #undef MAX6675_SS
64
-#ifndef SDSUPPORT
65
-  #define MAX6675_SS       53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card
66
-#else
64
+#if ENABLED(SDSUPPORT)
67 65
   #define MAX6675_SS       49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
66
+#else
67
+  #define MAX6675_SS       53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card
68 68
 #endif
69 69
 
70 70
 // RigidBot swaps E0 / E1 plugs vs RAMPS 1.3

+ 8
- 8
Marlin/pins_RUMBA.h View File

@@ -48,36 +48,36 @@
48 48
 #define PS_ON_PIN          45
49 49
 #define KILL_PIN           46
50 50
 
51
-#if (TEMP_SENSOR_0==0)
51
+#if TEMP_SENSOR_0 == 0
52 52
   #define TEMP_0_PIN           -1
53 53
   #define HEATER_0_PIN         -1
54 54
 #else
55 55
   #define HEATER_0_PIN          2   // EXTRUDER 1
56
-  #if (TEMP_SENSOR_0==-1)
56
+  #if TEMP_SENSOR_0 == -1
57 57
     #define TEMP_0_PIN          6   // ANALOG NUMBERING - connector *K1* on RUMBA thermocouple ADD ON is used
58 58
   #else
59 59
     #define TEMP_0_PIN         15   // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used
60 60
   #endif
61 61
 #endif
62 62
 
63
-#if (TEMP_SENSOR_1==0)
63
+#if TEMP_SENSOR_1 == 0
64 64
   #define TEMP_1_PIN           -1
65 65
   #define HEATER_1_PIN         -1
66 66
 #else
67 67
   #define HEATER_1_PIN          3   // EXTRUDER 2
68
-  #if (TEMP_SENSOR_1==-1)
68
+  #if TEMP_SENSOR_1 == -1
69 69
     #define TEMP_1_PIN          5   // ANALOG NUMBERING - connector *K2* on RUMBA thermocouple ADD ON is used
70 70
   #else
71 71
     #define TEMP_1_PIN         14   // ANALOG NUMBERING - default connector for thermistor *T1* on rumba board is used
72 72
   #endif
73 73
 #endif
74 74
 
75
-#if (TEMP_SENSOR_2==0)
75
+#if TEMP_SENSOR_2 == 0
76 76
   #define TEMP_2_PIN          -1
77 77
   #define HEATER_2_PIN        -1
78 78
 #else
79 79
   #define HEATER_2_PIN         6    // EXTRUDER 3
80
-  #if (TEMP_SENSOR_2==-1)
80
+  #if TEMP_SENSOR_2 == -1
81 81
     #define TEMP_2_PIN         7    // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_BED is defined as thermocouple
82 82
   #else
83 83
     #define TEMP_2_PIN         13   // ANALOG NUMBERING - default connector for thermistor *T2* on rumba board is used
@@ -87,12 +87,12 @@
87 87
 //optional for extruder 4 or chamber: #define TEMP_X_PIN         12   // ANALOG NUMBERING - default connector for thermistor *T3* on rumba board is used
88 88
 //optional FAN1 can be used as 4th heater output: #define HEATER_3_PIN       8    // EXTRUDER 4
89 89
 
90
-#if (TEMP_SENSOR_BED==0)
90
+#if TEMP_SENSOR_BED == 0
91 91
   #define TEMP_BED_PIN        -1
92 92
   #define HEATER_BED_PIN      -1
93 93
 #else
94 94
   #define HEATER_BED_PIN       9    // BED
95
-  #if (TEMP_SENSOR_BED==-1)
95
+  #if TEMP_SENSOR_BED == -1
96 96
     #define TEMP_BED_PIN       7    // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_2 is defined as thermocouple
97 97
   #else
98 98
     #define TEMP_BED_PIN      11    // ANALOG NUMBERING - default connector for thermistor *THB* on rumba board is used

+ 6
- 6
Marlin/planner.cpp View File

@@ -542,7 +542,7 @@ float junction_deviation = 0.1;
542 542
     block->steps[A_AXIS] = labs(dx + dy);
543 543
     block->steps[B_AXIS] = labs(dx - dy);
544 544
     block->steps[Z_AXIS] = labs(dz);
545
-  #elif defined(COREXZ)
545
+  #elif ENABLED(COREXZ)
546 546
     // corexz planning
547 547
     block->steps[A_AXIS] = labs(dx + dz);
548 548
     block->steps[Y_AXIS] = labs(dy);
@@ -577,7 +577,7 @@ float junction_deviation = 0.1;
577 577
     if (dz < 0) db |= BIT(Z_AXIS);
578 578
     if (dx + dy < 0) db |= BIT(A_AXIS); // Motor A direction
579 579
     if (dx - dy < 0) db |= BIT(B_AXIS); // Motor B direction
580
-  #elif defined(COREXZ)
580
+  #elif ENABLED(COREXZ)
581 581
     if (dx < 0) db |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis
582 582
     if (dy < 0) db |= BIT(Y_AXIS);
583 583
     if (dz < 0) db |= BIT(Z_HEAD); // ...and Z
@@ -599,10 +599,10 @@ float junction_deviation = 0.1;
599 599
       enable_x();
600 600
       enable_y();
601 601
     }
602
-    #ifndef Z_LATE_ENABLE
602
+    #if DISABLED(Z_LATE_ENABLE)
603 603
       if (block->steps[Z_AXIS]) enable_z();
604 604
     #endif
605
-  #elif defined(COREXZ)
605
+  #elif ENABLED(COREXZ)
606 606
     if (block->steps[A_AXIS] || block->steps[C_AXIS]) {
607 607
       enable_x();
608 608
       enable_z();
@@ -611,7 +611,7 @@ float junction_deviation = 0.1;
611 611
   #else
612 612
     if (block->steps[X_AXIS]) enable_x();
613 613
     if (block->steps[Y_AXIS]) enable_y();
614
-    #ifndef Z_LATE_ENABLE
614
+    #if DISABLED(Z_LATE_ENABLE)
615 615
       if (block->steps[Z_AXIS]) enable_z();
616 616
     #endif
617 617
   #endif
@@ -700,7 +700,7 @@ float junction_deviation = 0.1;
700 700
     delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
701 701
     delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS];
702 702
     delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS];
703
-  #elif defined(COREXZ)
703
+  #elif ENABLED(COREXZ)
704 704
     float delta_mm[6];
705 705
     delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
706 706
     delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];

+ 1
- 1
Marlin/servo.cpp View File

@@ -307,7 +307,7 @@ bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
307 307
 void Servo::move(int value) {
308 308
   if (this->attach(0) >= 0) {
309 309
     this->write(value);
310
-    #ifdef DEACTIVATE_SERVOS_AFTER_MOVE
310
+    #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
311 311
       delay(SERVO_DEACTIVATION_DELAY);
312 312
       this->detach();
313 313
     #endif

+ 14
- 14
Marlin/stepper.cpp View File

@@ -289,7 +289,7 @@ void enable_endstops(bool check) { check_endstops = check; }
289 289
 // Check endstops
290 290
 inline void update_endstops() {
291 291
   
292
-  #ifdef Z_DUAL_ENDSTOPS
292
+  #if ENABLED(Z_DUAL_ENDSTOPS)
293 293
     uint16_t
294 294
   #else
295 295
     byte
@@ -317,12 +317,12 @@ inline void update_endstops() {
317 317
       step_events_completed = current_block->step_event_count; \
318 318
     }
319 319
   
320
-  #ifdef COREXY
320
+  #if ENABLED(COREXY)
321 321
     // Head direction in -X axis for CoreXY bots.
322 322
     // If DeltaX == -DeltaY, the movement is only in Y axis
323 323
     if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) {
324 324
       if (TEST(out_bits, X_HEAD))
325
-  #elif defined(COREXZ)
325
+  #elif ENABLED(COREXZ)
326 326
     // Head direction in -X axis for CoreXZ bots.
327 327
     // If DeltaX == -DeltaZ, the movement is only in Z axis
328 328
     if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, C_AXIS))) {
@@ -331,7 +331,7 @@ inline void update_endstops() {
331 331
       if (TEST(out_bits, X_AXIS))   // stepping along -X axis (regular Cartesian bot)
332 332
   #endif
333 333
       { // -direction
334
-        #ifdef DUAL_X_CARRIAGE
334
+        #if ENABLED(DUAL_X_CARRIAGE)
335 335
           // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
336 336
           if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
337 337
         #endif
@@ -342,7 +342,7 @@ inline void update_endstops() {
342 342
           }
343 343
       }
344 344
       else { // +direction
345
-        #ifdef DUAL_X_CARRIAGE
345
+        #if ENABLED(DUAL_X_CARRIAGE)
346 346
           // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
347 347
           if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
348 348
         #endif
@@ -352,11 +352,11 @@ inline void update_endstops() {
352 352
             #endif
353 353
           }
354 354
       }
355
-  #if defined(COREXY) || defined(COREXZ)
355
+  #if ENABLED(COREXY) || ENABLED(COREXZ)
356 356
     }
357 357
   #endif
358 358
 
359
-  #ifdef COREXY
359
+  #if ENABLED(COREXY)
360 360
     // Head direction in -Y axis for CoreXY bots.
361 361
     // If DeltaX == DeltaY, the movement is only in X axis
362 362
     if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS))) {
@@ -374,11 +374,11 @@ inline void update_endstops() {
374 374
           UPDATE_ENDSTOP(Y, MAX);
375 375
         #endif
376 376
       }
377
-  #if defined(COREXY)
377
+  #if ENABLED(COREXY)
378 378
     }
379 379
   #endif
380 380
 
381
-  #ifdef COREXZ
381
+  #if ENABLED(COREXZ)
382 382
     // Head direction in -Z axis for CoreXZ bots.
383 383
     // If DeltaX == DeltaZ, the movement is only in X axis
384 384
     if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, C_AXIS))) {
@@ -389,7 +389,7 @@ inline void update_endstops() {
389 389
       { // z -direction
390 390
         #if HAS_Z_MIN
391 391
 
392
-          #ifdef Z_DUAL_ENDSTOPS
392
+          #if ENABLED(Z_DUAL_ENDSTOPS)
393 393
             SET_ENDSTOP_BIT(Z, MIN);
394 394
               #if HAS_Z2_MIN
395 395
                 SET_ENDSTOP_BIT(Z2, MIN);
@@ -411,7 +411,7 @@ inline void update_endstops() {
411 411
           #endif // !Z_DUAL_ENDSTOPS
412 412
         #endif // Z_MIN_PIN
413 413
 
414
-        #ifdef Z_PROBE_ENDSTOP
414
+        #if ENABLED(Z_PROBE_ENDSTOP)
415 415
           UPDATE_ENDSTOP(Z, PROBE);
416 416
 
417 417
           if (TEST_ENDSTOP(Z_PROBE))
@@ -424,7 +424,7 @@ inline void update_endstops() {
424 424
       else { // z +direction
425 425
         #if HAS_Z_MAX
426 426
 
427
-          #ifdef Z_DUAL_ENDSTOPS
427
+          #if ENABLED(Z_DUAL_ENDSTOPS)
428 428
 
429 429
             SET_ENDSTOP_BIT(Z, MAX);
430 430
               #if HAS_Z2_MAX
@@ -449,7 +449,7 @@ inline void update_endstops() {
449 449
           #endif // !Z_DUAL_ENDSTOPS
450 450
         #endif // Z_MAX_PIN
451 451
         
452
-        #ifdef Z_PROBE_ENDSTOP
452
+        #if ENABLED(Z_PROBE_ENDSTOP)
453 453
           UPDATE_ENDSTOP(Z, PROBE);
454 454
           
455 455
           if (TEST_ENDSTOP(Z_PROBE))
@@ -459,7 +459,7 @@ inline void update_endstops() {
459 459
           }
460 460
         #endif
461 461
       }
462
-  #if defined(COREXZ)
462
+  #if ENABLED(COREXZ)
463 463
     }
464 464
   #endif  
465 465
   old_endstop_bits = current_endstop_bits;

+ 1
- 1
Marlin/ultralcd.cpp View File

@@ -275,7 +275,7 @@ static void lcd_status_screen() {
275 275
 
276 276
   #if ENABLED(LCD_PROGRESS_BAR)
277 277
     millis_t ms = millis();
278
-    #ifndef PROGRESS_MSG_ONCE
278
+    #if DISABLED(PROGRESS_MSG_ONCE)
279 279
       if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
280 280
         progress_bar_ms = ms;
281 281
       }

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -6,7 +6,7 @@
6 6
 * When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
7 7
 **/
8 8
 
9
-//#ifndef REPRAPWORLD_KEYPAD
9
+//#if DISABLED(REPRAPWORLD_KEYPAD)
10 10
 //  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
11 11
 //#else
12 12
   extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.

Loading…
Cancel
Save