Преглед на файлове

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

Scott Lahteine преди 8 години
родител
ревизия
b4abb0ae7f
променени са 3 файла, в които са добавени 235 реда и са изтрити 235 реда
  1. 18
    18
      Marlin/Marlin.h
  2. 7
    7
      Marlin/Marlin.ino
  3. 210
    210
      Marlin/Marlin_main.cpp

+ 18
- 18
Marlin/Marlin.h Целия файл

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

+ 7
- 7
Marlin/Marlin.ino Целия файл

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

+ 210
- 210
Marlin/Marlin_main.cpp
Файловите разлики са ограничени, защото са твърде много
Целия файл


Loading…
Отказ
Запис