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

Apply remaining ENABLED/DISABLED conditionals

Scott Lahteine пре 10 година
родитељ
комит
46453905d6
29 измењених фајлова са 61 додато и 61 уклоњено
  1. 1
    1
      Marlin/Conditionals.h
  2. 3
    3
      Marlin/M100_Free_Mem_Chk.cpp
  3. 7
    7
      Marlin/Marlin_main.cpp
  4. 1
    1
      Marlin/buzzer.cpp
  5. 3
    3
      Marlin/dogm_lcd_implementation.h
  6. 1
    1
      Marlin/example_configurations/Felix/Configuration.h
  7. 2
    2
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  8. 1
    1
      Marlin/example_configurations/Hephestos/Configuration.h
  9. 1
    1
      Marlin/example_configurations/K8200/Configuration.h
  10. 1
    1
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  11. 1
    1
      Marlin/example_configurations/SCARA/Configuration.h
  12. 1
    1
      Marlin/example_configurations/WITBOX/Configuration.h
  13. 1
    1
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  14. 1
    1
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  15. 1
    1
      Marlin/example_configurations/delta/generic/Configuration.h
  16. 1
    1
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  17. 1
    1
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  18. 1
    1
      Marlin/example_configurations/makibox/Configuration.h
  19. 1
    1
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  20. 1
    1
      Marlin/pins_MEGACONTROLLER.h
  21. 1
    1
      Marlin/pins_MEGATRONICS.h
  22. 1
    1
      Marlin/pins_PRINTRBOARD.h
  23. 1
    1
      Marlin/pins_RAMPS_13.h
  24. 4
    4
      Marlin/pins_RIGIDBOARD.h
  25. 6
    6
      Marlin/planner.cpp
  26. 1
    1
      Marlin/servo.cpp
  27. 14
    14
      Marlin/stepper.cpp
  28. 1
    1
      Marlin/ultralcd.cpp
  29. 1
    1
      Marlin/ultralcd_implementation_hitachi_HD44780.h

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

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

+ 3
- 3
Marlin/M100_Free_Mem_Chk.cpp Прегледај датотеку

23
 
23
 
24
 #include "Marlin.h"
24
 #include "Marlin.h"
25
 
25
 
26
-#ifdef M100_FREE_MEMORY_WATCHER
26
+#if ENABLED(M100_FREE_MEMORY_WATCHER)
27
 extern void *__brkval;
27
 extern void *__brkval;
28
 extern size_t  __heap_start, __heap_end, __flp;
28
 extern size_t  __heap_start, __heap_end, __flp;
29
 
29
 
73
 // the right hand column to help spotting them.
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
 	if ( code_seen('D') ) {
77
 	if ( code_seen('D') ) {
78
  		ptr = (unsigned char *) __brkval;
78
  		ptr = (unsigned char *) __brkval;
79
 
79
 
163
 // M100 C x  Corrupts x locations in the free memory pool and reports the locations of the corruption.
163
 // M100 C x  Corrupts x locations in the free memory pool and reports the locations of the corruption.
164
 // This is useful to check the correctness of the M100 D and the M100 F commands.
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
 	if ( code_seen('C') ) {
167
 	if ( code_seen('C') ) {
168
 		int x;			// x gets the # of locations to corrupt within the memory pool
168
 		int x;			// x gets the # of locations to corrupt within the memory pool
169
 		x = code_value();
169
 		x = code_value();

+ 7
- 7
Marlin/Marlin_main.cpp Прегледај датотеку

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

+ 1
- 1
Marlin/buzzer.cpp Прегледај датотеку

9
         lcd_buzz(duration, freq);
9
         lcd_buzz(duration, freq);
10
       #elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
10
       #elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
11
         SET_OUTPUT(BEEPER_PIN);
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
           //tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
13
           //tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
14
           unsigned int delay = 1000000 / freq / 2;
14
           unsigned int delay = 1000000 / freq / 2;
15
           int i = duration * freq / 1000;
15
           int i = duration * freq / 1000;

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

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

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

301
 // coarse Endstop Settings
301
 // coarse Endstop Settings
302
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
305
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
306
   // #define ENDSTOPPULLUP_XMAX
306
   // #define ENDSTOPPULLUP_XMAX
307
   // #define ENDSTOPPULLUP_YMAX
307
   // #define ENDSTOPPULLUP_YMAX

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

286
 // coarse Endstop Settings
286
 // coarse Endstop Settings
287
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
290
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
291
   // #define ENDSTOPPULLUP_XMAX
291
   // #define ENDSTOPPULLUP_XMAX
292
   // #define ENDSTOPPULLUP_YMAX
292
   // #define ENDSTOPPULLUP_YMAX
727
 // With this option servos are powered only during movement, then turned off to prevent jitter.
727
 // With this option servos are powered only during movement, then turned off to prevent jitter.
728
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
728
 //#define DEACTIVATE_SERVOS_AFTER_MOVE
729
 
729
 
730
-#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
730
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
731
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
731
   // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
732
   // 300ms is a good value but you can try less delay.
732
   // 300ms is a good value but you can try less delay.
733
   // If the servo can't reach the requested position, increase it.
733
   // If the servo can't reach the requested position, increase it.

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

311
 // coarse Endstop Settings
311
 // coarse Endstop Settings
312
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
315
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
316
   // #define ENDSTOPPULLUP_XMAX
316
   // #define ENDSTOPPULLUP_XMAX
317
   // #define ENDSTOPPULLUP_YMAX
317
   // #define ENDSTOPPULLUP_YMAX

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

307
 // coarse Endstop Settings
307
 // coarse Endstop Settings
308
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
311
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
312
   // #define ENDSTOPPULLUP_XMAX
312
   // #define ENDSTOPPULLUP_XMAX
313
   // #define ENDSTOPPULLUP_YMAX
313
   // #define ENDSTOPPULLUP_YMAX

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

319
 // coarse Endstop Settings
319
 // coarse Endstop Settings
320
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
323
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
324
   // #define ENDSTOPPULLUP_XMAX
324
   // #define ENDSTOPPULLUP_XMAX
325
   // #define ENDSTOPPULLUP_YMAX
325
   // #define ENDSTOPPULLUP_YMAX

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

327
 // coarse Endstop Settings
327
 // coarse Endstop Settings
328
 //#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
331
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
332
   // #define ENDSTOPPULLUP_XMAX
332
   // #define ENDSTOPPULLUP_XMAX
333
   // #define ENDSTOPPULLUP_YMAX
333
   // #define ENDSTOPPULLUP_YMAX

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

311
 // coarse Endstop Settings
311
 // coarse Endstop Settings
312
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
315
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
316
   // #define ENDSTOPPULLUP_XMAX
316
   // #define ENDSTOPPULLUP_XMAX
317
   // #define ENDSTOPPULLUP_YMAX
317
   // #define ENDSTOPPULLUP_YMAX

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

319
 // coarse Endstop Settings
319
 // coarse Endstop Settings
320
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
323
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
324
   // #define ENDSTOPPULLUP_XMAX
324
   // #define ENDSTOPPULLUP_XMAX
325
   // #define ENDSTOPPULLUP_YMAX
325
   // #define ENDSTOPPULLUP_YMAX

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

354
 // coarse Endstop Settings
354
 // coarse Endstop Settings
355
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
358
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
359
   // #define ENDSTOPPULLUP_XMAX
359
   // #define ENDSTOPPULLUP_XMAX
360
   // #define ENDSTOPPULLUP_YMAX
360
   // #define ENDSTOPPULLUP_YMAX

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

354
 // coarse Endstop Settings
354
 // coarse Endstop Settings
355
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
358
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
359
   // #define ENDSTOPPULLUP_XMAX
359
   // #define ENDSTOPPULLUP_XMAX
360
   // #define ENDSTOPPULLUP_YMAX
360
   // #define ENDSTOPPULLUP_YMAX

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

354
 // coarse Endstop Settings
354
 // coarse Endstop Settings
355
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
358
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
359
   // #define ENDSTOPPULLUP_XMAX
359
   // #define ENDSTOPPULLUP_XMAX
360
   // #define ENDSTOPPULLUP_YMAX
360
   // #define ENDSTOPPULLUP_YMAX

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

341
 // coarse Endstop Settings
341
 // coarse Endstop Settings
342
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
345
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
346
   // #define ENDSTOPPULLUP_XMAX
346
   // #define ENDSTOPPULLUP_XMAX
347
   // #define ENDSTOPPULLUP_YMAX
347
   // #define ENDSTOPPULLUP_YMAX

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

322
 // coarse Endstop Settings
322
 // coarse Endstop Settings
323
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
326
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
327
   // #define ENDSTOPPULLUP_XMAX
327
   // #define ENDSTOPPULLUP_XMAX
328
   // #define ENDSTOPPULLUP_YMAX
328
   // #define ENDSTOPPULLUP_YMAX

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

309
 // coarse Endstop Settings
309
 // coarse Endstop Settings
310
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
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
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
313
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
314
   // #define ENDSTOPPULLUP_XMAX
314
   // #define ENDSTOPPULLUP_XMAX
315
   // #define ENDSTOPPULLUP_YMAX
315
   // #define ENDSTOPPULLUP_YMAX

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

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

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

60
 
60
 
61
 #define BEEPER_PIN         33   // AUX-4
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
   #define LCD_PINS_RS     16
65
   #define LCD_PINS_RS     16
66
   #define LCD_PINS_ENABLE 17
66
   #define LCD_PINS_ENABLE 17

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

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

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

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

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

46
   #undef  SD_DETECT_PIN
46
   #undef  SD_DETECT_PIN
47
   #define SD_DETECT_PIN 22
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
   #undef BEEPER_PIN
51
   #undef BEEPER_PIN
52
   #define BEEPER_PIN -1
52
   #define BEEPER_PIN -1
61
 
61
 
62
 // SPI for Max6675 Thermocouple
62
 // SPI for Max6675 Thermocouple
63
 #undef MAX6675_SS
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
   #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
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
 #endif
68
 #endif
69
 
69
 
70
 // RigidBot swaps E0 / E1 plugs vs RAMPS 1.3
70
 // RigidBot swaps E0 / E1 plugs vs RAMPS 1.3

+ 6
- 6
Marlin/planner.cpp Прегледај датотеку

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

+ 1
- 1
Marlin/servo.cpp Прегледај датотеку

307
 void Servo::move(int value) {
307
 void Servo::move(int value) {
308
   if (this->attach(0) >= 0) {
308
   if (this->attach(0) >= 0) {
309
     this->write(value);
309
     this->write(value);
310
-    #ifdef DEACTIVATE_SERVOS_AFTER_MOVE
310
+    #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
311
       delay(SERVO_DEACTIVATION_DELAY);
311
       delay(SERVO_DEACTIVATION_DELAY);
312
       this->detach();
312
       this->detach();
313
     #endif
313
     #endif

+ 14
- 14
Marlin/stepper.cpp Прегледај датотеку

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

+ 1
- 1
Marlin/ultralcd.cpp Прегледај датотеку

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

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

6
 * When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
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
 //  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
10
 //  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
11
 //#else
11
 //#else
12
   extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
12
   extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.

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