Browse Source

Apply ENABLED / DISABLED to Marlin core files (PR#2558)

Scott Lahteine 9 years ago
parent
commit
b4abb0ae7f
3 changed files with 235 additions and 235 deletions
  1. 18
    18
      Marlin/Marlin.h
  2. 7
    7
      Marlin/Marlin.ino
  3. 210
    210
      Marlin/Marlin_main.cpp

+ 18
- 18
Marlin/Marlin.h View File

51
 #include "WString.h"
51
 #include "WString.h"
52
 
52
 
53
 #ifdef USBCON
53
 #ifdef USBCON
54
-  #ifdef BTENABLED
54
+  #if ENABLED(BTENABLED)
55
     #define MYSERIAL bt
55
     #define MYSERIAL bt
56
   #else
56
   #else
57
     #define MYSERIAL Serial
57
     #define MYSERIAL Serial
110
 
110
 
111
 void manage_inactivity(bool ignore_stepper_queue=false);
111
 void manage_inactivity(bool ignore_stepper_queue=false);
112
 
112
 
113
-#if defined(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
113
+#if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
114
   #define  enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
114
   #define  enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
115
   #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)
115
   #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)
116
 #elif HAS_X_ENABLE
116
 #elif HAS_X_ENABLE
122
 #endif
122
 #endif
123
 
123
 
124
 #if HAS_Y_ENABLE
124
 #if HAS_Y_ENABLE
125
-  #ifdef Y_DUAL_STEPPER_DRIVERS
125
+  #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
126
     #define  enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
126
     #define  enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
127
     #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
127
     #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
128
   #else
128
   #else
135
 #endif
135
 #endif
136
 
136
 
137
 #if HAS_Z_ENABLE
137
 #if HAS_Z_ENABLE
138
-  #ifdef Z_DUAL_STEPPER_DRIVERS
138
+  #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
139
     #define  enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
139
     #define  enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
140
     #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
140
     #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
141
   #else
141
   #else
205
 void kill(const char *);
205
 void kill(const char *);
206
 void Stop();
206
 void Stop();
207
 
207
 
208
-#ifdef FILAMENT_RUNOUT_SENSOR
208
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
209
   void filrunout();
209
   void filrunout();
210
 #endif
210
 #endif
211
 
211
 
234
 extern millis_t previous_cmd_ms;
234
 extern millis_t previous_cmd_ms;
235
 inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
235
 inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
236
 
236
 
237
-#ifdef FAST_PWM_FAN
237
+#if ENABLED(FAST_PWM_FAN)
238
   void setPwmFrequency(uint8_t pin, int val);
238
   void setPwmFrequency(uint8_t pin, int val);
239
 #endif
239
 #endif
240
 
240
 
255
 extern float max_pos[3]; // axis[n].max_pos
255
 extern float max_pos[3]; // axis[n].max_pos
256
 extern bool axis_known_position[3]; // axis[n].is_known
256
 extern bool axis_known_position[3]; // axis[n].is_known
257
 
257
 
258
-#if defined(DELTA) || defined(SCARA)
258
+#if ENABLED(DELTA) || ENABLED(SCARA)
259
   void calculate_delta(float cartesian[3]);
259
   void calculate_delta(float cartesian[3]);
260
-  #ifdef DELTA
260
+  #if ENABLED(DELTA)
261
     extern float delta[3];
261
     extern float delta[3];
262
     extern float endstop_adj[3]; // axis[n].endstop_adj
262
     extern float endstop_adj[3]; // axis[n].endstop_adj
263
     extern float delta_radius;
263
     extern float delta_radius;
264
     extern float delta_diagonal_rod;
264
     extern float delta_diagonal_rod;
265
     extern float delta_segments_per_second;
265
     extern float delta_segments_per_second;
266
     void recalc_delta_settings(float radius, float diagonal_rod);
266
     void recalc_delta_settings(float radius, float diagonal_rod);
267
-    #ifdef ENABLE_AUTO_BED_LEVELING
267
+    #if ENABLED(ENABLE_AUTO_BED_LEVELING)
268
       extern int delta_grid_spacing[2];
268
       extern int delta_grid_spacing[2];
269
       void adjust_delta(float cartesian[3]);
269
       void adjust_delta(float cartesian[3]);
270
     #endif
270
     #endif
271
-  #elif defined(SCARA)
271
+  #elif ENABLED(SCARA)
272
     extern float axis_scaling[3];  // Build size scaling
272
     extern float axis_scaling[3];  // Build size scaling
273
     void calculate_SCARA_forward_Transform(float f_scara[3]);
273
     void calculate_SCARA_forward_Transform(float f_scara[3]);
274
   #endif
274
   #endif
275
 #endif
275
 #endif
276
 
276
 
277
-#ifdef Z_DUAL_ENDSTOPS
277
+#if ENABLED(Z_DUAL_ENDSTOPS)
278
   extern float z_endstop_adj;
278
   extern float z_endstop_adj;
279
 #endif
279
 #endif
280
 
280
 
281
-#ifdef ENABLE_AUTO_BED_LEVELING
281
+#if ENABLED(ENABLE_AUTO_BED_LEVELING)
282
   extern float zprobe_zoffset;
282
   extern float zprobe_zoffset;
283
 #endif
283
 #endif
284
 
284
 
285
-#ifdef PREVENT_DANGEROUS_EXTRUDE
285
+#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
286
   extern float extrude_min_temp;
286
   extern float extrude_min_temp;
287
 #endif
287
 #endif
288
 
288
 
289
 extern int fanSpeed;
289
 extern int fanSpeed;
290
 
290
 
291
-#ifdef BARICUDA
291
+#if ENABLED(BARICUDA)
292
   extern int ValvePressure;
292
   extern int ValvePressure;
293
   extern int EtoPPressure;
293
   extern int EtoPPressure;
294
 #endif
294
 #endif
295
 
295
 
296
-#ifdef FAN_SOFT_PWM
296
+#if ENABLED(FAN_SOFT_PWM)
297
   extern unsigned char fanSpeedSoftPwm;
297
   extern unsigned char fanSpeedSoftPwm;
298
 #endif
298
 #endif
299
 
299
 
300
-#ifdef FILAMENT_SENSOR
300
+#if ENABLED(FILAMENT_SENSOR)
301
   extern float filament_width_nominal;  //holds the theoretical filament diameter ie., 3.00 or 1.75
301
   extern float filament_width_nominal;  //holds the theoretical filament diameter ie., 3.00 or 1.75
302
   extern bool filament_sensor;  //indicates that filament sensor readings should control extrusion
302
   extern bool filament_sensor;  //indicates that filament sensor readings should control extrusion
303
   extern float filament_width_meas; //holds the filament diameter as accurately measured
303
   extern float filament_width_meas; //holds the filament diameter as accurately measured
307
   extern int meas_delay_cm; //delay distance
307
   extern int meas_delay_cm; //delay distance
308
 #endif
308
 #endif
309
 
309
 
310
-#ifdef FWRETRACT
310
+#if ENABLED(FWRETRACT)
311
   extern bool autoretract_enabled;
311
   extern bool autoretract_enabled;
312
   extern bool retracted[EXTRUDERS]; // extruder[n].retracted
312
   extern bool retracted[EXTRUDERS]; // extruder[n].retracted
313
   extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
313
   extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
320
 // Handling multiple extruders pins
320
 // Handling multiple extruders pins
321
 extern uint8_t active_extruder;
321
 extern uint8_t active_extruder;
322
 
322
 
323
-#ifdef DIGIPOT_I2C
323
+#if ENABLED(DIGIPOT_I2C)
324
   extern void digipot_i2c_set_current( int channel, float current );
324
   extern void digipot_i2c_set_current( int channel, float current );
325
   extern void digipot_i2c_init();
325
   extern void digipot_i2c_init();
326
 #endif
326
 #endif

+ 7
- 7
Marlin/Marlin.ino View File

33
 #include "Configuration.h"
33
 #include "Configuration.h"
34
 #include "pins.h"
34
 #include "pins.h"
35
 
35
 
36
-#ifdef ULTRA_LCD
37
-  #if defined(LCD_I2C_TYPE_PCF8575)
36
+#if ENABLED(ULTRA_LCD)
37
+  #if ENABLED(LCD_I2C_TYPE_PCF8575)
38
     #include <Wire.h>
38
     #include <Wire.h>
39
     #include <LiquidCrystal_I2C.h>
39
     #include <LiquidCrystal_I2C.h>
40
-  #elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)
40
+  #elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)
41
     #include <Wire.h>
41
     #include <Wire.h>
42
     #include <LiquidTWI2.h>
42
     #include <LiquidTWI2.h>
43
-  #elif defined(DOGLCD)
43
+  #elif ENABLED(DOGLCD)
44
     #include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
44
     #include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
45
   #else
45
   #else
46
     #include <LiquidCrystal.h> // library for character LCD
46
     #include <LiquidCrystal.h> // library for character LCD
51
   #include <SPI.h>
51
   #include <SPI.h>
52
 #endif
52
 #endif
53
 
53
 
54
-#if defined(DIGIPOT_I2C)
54
+#if ENABLED(DIGIPOT_I2C)
55
   #include <Wire.h>
55
   #include <Wire.h>
56
 #endif
56
 #endif
57
 
57
 
58
-#ifdef HAVE_TMCDRIVER
58
+#if ENABLED(HAVE_TMCDRIVER)
59
   #include <SPI.h>
59
   #include <SPI.h>
60
   #include <TMC26XStepper.h>
60
   #include <TMC26XStepper.h>
61
 #endif
61
 #endif
62
 
62
 
63
-#ifdef HAVE_L6470DRIVER
63
+#if ENABLED(HAVE_L6470DRIVER)
64
   #include <SPI.h>
64
   #include <SPI.h>
65
   #include <L6470.h>
65
   #include <L6470.h>
66
 #endif
66
 #endif

+ 210
- 210
Marlin/Marlin_main.cpp
File diff suppressed because it is too large
View File


Loading…
Cancel
Save