Просмотр исходного кода

Upstream commits, allow no extruder in M105

Scott Lahteine 9 лет назад
Родитель
Сommit
713953d8c1
34 измененных файлов: 826 добавлений и 671 удалений
  1. 76
    18
      Marlin/Conditionals.h
  2. 14
    14
      Marlin/Configuration.h
  3. 2
    2
      Marlin/ConfigurationStore.cpp
  4. 3
    3
      Marlin/Configuration_adv.h
  5. 8
    10
      Marlin/Marlin.h
  6. 427
    500
      Marlin/Marlin_main.cpp
  7. 21
    3
      Marlin/SanityCheck.h
  8. 15
    1
      Marlin/configurator/config/Configuration.h
  9. 3
    3
      Marlin/configurator/config/Configuration_adv.h
  10. 1
    1
      Marlin/dogm_lcd_implementation.h
  11. 15
    1
      Marlin/example_configurations/Felix/Configuration.h
  12. 15
    1
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  13. 3
    3
      Marlin/example_configurations/Felix/Configuration_adv.h
  14. 15
    1
      Marlin/example_configurations/Hephestos/Configuration.h
  15. 3
    3
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  16. 15
    1
      Marlin/example_configurations/K8200/Configuration.h
  17. 3
    3
      Marlin/example_configurations/K8200/Configuration_adv.h
  18. 15
    1
      Marlin/example_configurations/SCARA/Configuration.h
  19. 3
    3
      Marlin/example_configurations/SCARA/Configuration_adv.h
  20. 15
    1
      Marlin/example_configurations/WITBOX/Configuration.h
  21. 3
    3
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  22. 19
    5
      Marlin/example_configurations/delta/generic/Configuration.h
  23. 3
    3
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  24. 19
    5
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  25. 3
    3
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  26. 15
    1
      Marlin/example_configurations/makibox/Configuration.h
  27. 3
    3
      Marlin/example_configurations/makibox/Configuration_adv.h
  28. 15
    1
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  29. 3
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  30. 1
    1
      Marlin/mesh_bed_leveling.h
  31. 3
    3
      Marlin/planner.cpp
  32. 58
    58
      Marlin/stepper.cpp
  33. 1
    1
      Marlin/temperature.h
  34. 8
    8
      Marlin/ultralcd.h

+ 76
- 18
Marlin/Conditionals.h Просмотреть файл

@@ -10,6 +10,8 @@
10 10
 
11 11
 #ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
12 12
 
13
+  #define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
14
+
13 15
   #define CONFIGURATION_LCD
14 16
 
15 17
   #if defined(MAKRPANEL)
@@ -279,7 +281,7 @@
279 281
     #define PS_ON_AWAKE  HIGH
280 282
     #define PS_ON_ASLEEP LOW
281 283
   #endif
282
-  #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN >= 0)
284
+  #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
283 285
 
284 286
   /**
285 287
    * Temp Sensor defines
@@ -350,25 +352,81 @@
350 352
   #endif
351 353
 
352 354
   /**
353
-   * Shorthand for pin tests, for temperature.cpp
355
+   * Shorthand for pin tests, used wherever needed
354 356
    */
355
-  #define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0 && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2)
356
-  #define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0 && TEMP_SENSOR_1 != 0)
357
-  #define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0 && TEMP_SENSOR_2 != 0)
358
-  #define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0 && TEMP_SENSOR_3 != 0)
359
-  #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0 && TEMP_SENSOR_BED != 0)
360
-  #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
361
-  #define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0)
362
-  #define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0)
363
-  #define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0)
364
-  #define HAS_HEATER_3 (defined(HEATER_3_PIN) && HEATER_3_PIN >= 0)
365
-  #define HAS_HEATER_BED (defined(HEATER_BED_PIN) && HEATER_BED_PIN >= 0)
366
-  #define HAS_AUTO_FAN_0 (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN >= 0)
367
-  #define HAS_AUTO_FAN_1 (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN >= 0)
368
-  #define HAS_AUTO_FAN_2 (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN >= 0)
369
-  #define HAS_AUTO_FAN_3 (defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN >= 0)
357
+  #define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2)
358
+  #define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0)
359
+  #define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0)
360
+  #define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0)
361
+  #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0)
362
+  #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
363
+  #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1))
364
+  #define HAS_HEATER_2 (PIN_EXISTS(HEATER_2))
365
+  #define HAS_HEATER_3 (PIN_EXISTS(HEATER_3))
366
+  #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))
367
+  #define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN))
368
+  #define HAS_AUTO_FAN_1 (PIN_EXISTS(EXTRUDER_1_AUTO_FAN))
369
+  #define HAS_AUTO_FAN_2 (PIN_EXISTS(EXTRUDER_2_AUTO_FAN))
370
+  #define HAS_AUTO_FAN_3 (PIN_EXISTS(EXTRUDER_3_AUTO_FAN))
370 371
   #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
371
-  #define HAS_FAN (defined(FAN_PIN) && FAN_PIN >= 0)
372
+  #define HAS_FAN (PIN_EXISTS(FAN))
373
+  #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
374
+  #define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
375
+  #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
376
+  #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
377
+  #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
378
+  #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
379
+  #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT))
380
+  #define HAS_HOME (PIN_EXISTS(HOME))
381
+  #define HAS_KILL (PIN_EXISTS(KILL))
382
+  #define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
383
+  #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
384
+  #define HAS_X_MIN (PIN_EXISTS(X_MIN))
385
+  #define HAS_X_MAX (PIN_EXISTS(X_MAX))
386
+  #define HAS_Y_MIN (PIN_EXISTS(Y_MIN))
387
+  #define HAS_Y_MAX (PIN_EXISTS(Y_MAX))
388
+  #define HAS_Z_MIN (PIN_EXISTS(Z_MIN))
389
+  #define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
390
+  #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
391
+  #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
392
+  #define HAS_Z_PROBE (PIN_EXISTS(Z_PROBE))
393
+  #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
394
+  #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
395
+  #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
396
+  #define HAS_MICROSTEPS (PIN_EXISTS(X_MS1))
397
+  #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
398
+  #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
399
+  #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
400
+  #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
401
+  #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
402
+  #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
403
+  #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
404
+  #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
405
+  #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
406
+  #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
407
+  #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
408
+  #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
409
+  #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
410
+  #define HAS_X_DIR (PIN_EXISTS(X_DIR))
411
+  #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
412
+  #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
413
+  #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
414
+  #define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
415
+  #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
416
+  #define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
417
+  #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
418
+  #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
419
+  #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
420
+  #define HAS_X_STEP (PIN_EXISTS(X_STEP))
421
+  #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
422
+  #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
423
+  #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
424
+  #define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
425
+  #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
426
+  #define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
427
+  #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
428
+  #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
429
+  #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
372 430
 
373 431
   /**
374 432
    * Helper Macros for heaters and extruder fan

+ 14
- 14
Marlin/Configuration.h Просмотреть файл

@@ -394,7 +394,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
394 394
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
395 395
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
396 396
 
397
-#if defined(MESH_BED_LEVELING)
397
+#ifdef MESH_BED_LEVELING
398 398
   #define MESH_MIN_X 10
399 399
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
400 400
   #define MESH_MIN_Y 10
@@ -499,19 +499,19 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
499 499
 
500 500
   #endif
501 501
 
502
-// Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
503
-// If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
504
-// If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
505
-// WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
506
-// To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
507
-// If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
508
-// RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
509
-// for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
510
-// The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
511
-// D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
512
-// WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
502
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
503
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
504
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
505
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
506
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
507
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
508
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
509
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
510
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
511
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
512
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
513 513
 
514
-//  #define Z_PROBE_ENDSTOP
514
+  //#define Z_PROBE_ENDSTOP
515 515
 
516 516
 #endif // ENABLE_AUTO_BED_LEVELING
517 517
 
@@ -691,7 +691,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
691 691
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
692 692
 // #define PHOTOGRAPH_PIN     23
693 693
 
694
-// SF send wrong arc g-codes when using Arc Point as fillet procedure
694
+// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
695 695
 //#define SF_ARC_FIX
696 696
 
697 697
 // Support for the BariCUDA Paste Extruder.

+ 2
- 2
Marlin/ConfigurationStore.cpp Просмотреть файл

@@ -78,7 +78,7 @@
78 78
 #include "ultralcd.h"
79 79
 #include "ConfigurationStore.h"
80 80
 
81
-#if defined(MESH_BED_LEVELING)
81
+#ifdef MESH_BED_LEVELING
82 82
    #include "mesh_bed_leveling.h"
83 83
 #endif  // MESH_BED_LEVELING
84 84
 
@@ -308,7 +308,7 @@ void Config_RetrieveSettings() {
308 308
 
309 309
     uint8_t mesh_num_x = 0;
310 310
     uint8_t mesh_num_y = 0;
311
-    #if defined(MESH_BED_LEVELING)
311
+    #ifdef MESH_BED_LEVELING
312 312
       EEPROM_READ_VAR(i, mbl.active);
313 313
       EEPROM_READ_VAR(i, mesh_num_x);
314 314
       EEPROM_READ_VAR(i, mesh_num_y);

+ 3
- 3
Marlin/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 2
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 2
181 181
 #define HOMING_BUMP_DIVISOR {2, 2, 4}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 8
- 10
Marlin/Marlin.h Просмотреть файл

@@ -110,11 +110,10 @@ void process_commands();
110 110
 
111 111
 void manage_inactivity(bool ignore_stepper_queue=false);
112 112
 
113
-#if defined(DUAL_X_CARRIAGE) && defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 \
114
-    && defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
113
+#if defined(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
115 114
   #define  enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
116 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)
117
-#elif defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
116
+#elif HAS_X_ENABLE
118 117
   #define  enable_x() X_ENABLE_WRITE( X_ENABLE_ON)
119 118
   #define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
120 119
 #else
@@ -122,7 +121,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
122 121
   #define disable_x() ;
123 122
 #endif
124 123
 
125
-#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
124
+#if HAS_Y_ENABLE
126 125
   #ifdef Y_DUAL_STEPPER_DRIVERS
127 126
     #define  enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
128 127
     #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
@@ -135,7 +134,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
135 134
   #define disable_y() ;
136 135
 #endif
137 136
 
138
-#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1
137
+#if HAS_Z_ENABLE
139 138
   #ifdef Z_DUAL_STEPPER_DRIVERS
140 139
     #define  enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
141 140
     #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
@@ -148,7 +147,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
148 147
   #define disable_z() ;
149 148
 #endif
150 149
 
151
-#if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1)
150
+#if HAS_E0_ENABLE
152 151
   #define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON)
153 152
   #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
154 153
 #else
@@ -156,7 +155,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
156 155
   #define disable_e0() /* nothing */
157 156
 #endif
158 157
 
159
-#if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1)
158
+#if (EXTRUDERS > 1) && HAS_E1_ENABLE
160 159
   #define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON)
161 160
   #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
162 161
 #else
@@ -164,7 +163,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
164 163
   #define disable_e1() /* nothing */
165 164
 #endif
166 165
 
167
-#if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1)
166
+#if (EXTRUDERS > 2) && HAS_E2_ENABLE
168 167
   #define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON)
169 168
   #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
170 169
 #else
@@ -172,7 +171,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
172 171
   #define disable_e2() /* nothing */
173 172
 #endif
174 173
 
175
-#if (EXTRUDERS > 3) && defined(E3_ENABLE_PIN) && (E3_ENABLE_PIN > -1)
174
+#if (EXTRUDERS > 3) && HAS_E3_ENABLE
176 175
   #define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON)
177 176
   #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
178 177
 #else
@@ -194,7 +193,6 @@ void get_coordinates();
194 193
     void adjust_delta(float cartesian[3]);
195 194
   #endif
196 195
   extern float delta[3];
197
-  void prepare_move_raw();
198 196
 #endif
199 197
 #ifdef SCARA
200 198
   void calculate_delta(float cartesian[3]);

+ 427
- 500
Marlin/Marlin_main.cpp
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 21
- 3
Marlin/SanityCheck.h Просмотреть файл

@@ -56,7 +56,7 @@
56 56
   #if EXTRUDERS > 1
57 57
 
58 58
     #if EXTRUDERS > 4
59
-      #error The maximum number of EXTRUDERS is 4.
59
+      #error The maximum number of EXTRUDERS in Marlin is 4.
60 60
     #endif
61 61
 
62 62
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
@@ -78,6 +78,13 @@
78 78
   #endif // EXTRUDERS > 1
79 79
 
80 80
   /**
81
+   * Limited number of servos
82
+   */
83
+  #if NUM_SERVOS > 4
84
+    #error The maximum number of SERVOS in Marlin is 4.
85
+  #endif
86
+
87
+  /**
81 88
    * Required LCD language
82 89
    */
83 90
   #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)
@@ -235,9 +242,9 @@
235 242
    */
236 243
   #ifdef DUAL_X_CARRIAGE
237 244
     #if EXTRUDERS == 1 || defined(COREXY) \
238
-        || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
245
+        || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
239 246
         || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
240
-        || !defined(X_MAX_PIN) || X_MAX_PIN < 0
247
+        || !HAS_X_MAX
241 248
       #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
242 249
     #endif
243 250
     #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
@@ -260,6 +267,10 @@
260 267
     #endif
261 268
   #endif
262 269
 
270
+  #if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN
271
+    #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN
272
+  #endif
273
+
263 274
   /**
264 275
    * Test required HEATER defines
265 276
    */
@@ -280,4 +291,11 @@
280 291
     #error HEATER_0_PIN not defined for this board
281 292
   #endif
282 293
 
294
+  /**
295
+   * Warnings for old configurations
296
+   */
297
+  #ifdef X_HOME_RETRACT_MM
298
+    #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM
299
+  #endif
300
+
283 301
 #endif //SANITYCHECK_H

+ 15
- 1
Marlin/configurator/config/Configuration.h Просмотреть файл

@@ -412,7 +412,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
412 412
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
413 413
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
414 414
 
415
-#if defined(MESH_BED_LEVELING)
415
+#ifdef MESH_BED_LEVELING
416 416
   #define MESH_MIN_X 10
417 417
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
418 418
   #define MESH_MIN_Y 10
@@ -519,6 +519,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
519 519
 
520 520
   #endif
521 521
 
522
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
523
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
524
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
525
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
526
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
527
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
528
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
529
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
530
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
531
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
532
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
533
+
534
+  //#define Z_PROBE_ENDSTOP
535
+
522 536
 #endif // ENABLE_AUTO_BED_LEVELING
523 537
 
524 538
 

+ 3
- 3
Marlin/configurator/config/Configuration_adv.h Просмотреть файл

@@ -189,9 +189,9 @@
189 189
 // @section homing
190 190
 
191 191
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
192
-#define X_HOME_RETRACT_MM 5
193
-#define Y_HOME_RETRACT_MM 5
194
-#define Z_HOME_RETRACT_MM 2
192
+#define X_HOME_BUMP_MM 5
193
+#define Y_HOME_BUMP_MM 5
194
+#define Z_HOME_BUMP_MM 2
195 195
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
196 196
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
197 197
 

+ 1
- 1
Marlin/dogm_lcd_implementation.h Просмотреть файл

@@ -300,7 +300,7 @@ static void lcd_implementation_status_screen() {
300 300
   // Fan
301 301
   lcd_setFont(FONT_STATUSMENU);
302 302
   u8g.setPrintPos(104,27);
303
-  #if defined(FAN_PIN) && FAN_PIN > -1
303
+  #if HAS_FAN
304 304
     int per = ((fanSpeed + 1) * 100) / 256;
305 305
     if (per) {
306 306
 

+ 15
- 1
Marlin/example_configurations/Felix/Configuration.h Просмотреть файл

@@ -364,7 +364,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
364 364
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
365 365
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
366 366
 
367
-#if defined(MESH_BED_LEVELING)
367
+#ifdef MESH_BED_LEVELING
368 368
   #define MESH_MIN_X 10
369 369
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
370 370
   #define MESH_MIN_Y 10
@@ -469,6 +469,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
469 469
 
470 470
   #endif
471 471
 
472
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
473
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
474
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
475
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
476
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
477
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
478
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
479
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
480
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
481
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
482
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
483
+
484
+  //#define Z_PROBE_ENDSTOP
485
+
472 486
 #endif // ENABLE_AUTO_BED_LEVELING
473 487
 
474 488
 

+ 15
- 1
Marlin/example_configurations/Felix/Configuration_DUAL.h Просмотреть файл

@@ -364,7 +364,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
364 364
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
365 365
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
366 366
 
367
-#if defined(MESH_BED_LEVELING)
367
+#ifdef MESH_BED_LEVELING
368 368
   #define MESH_MIN_X 10
369 369
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
370 370
   #define MESH_MIN_Y 10
@@ -469,6 +469,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
469 469
 
470 470
   #endif
471 471
 
472
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
473
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
474
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
475
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
476
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
477
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
478
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
479
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
480
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
481
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
482
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
483
+
484
+  //#define Z_PROBE_ENDSTOP
485
+
472 486
 #endif // ENABLE_AUTO_BED_LEVELING
473 487
 
474 488
 

+ 3
- 3
Marlin/example_configurations/Felix/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 3
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 3
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 15
- 1
Marlin/example_configurations/Hephestos/Configuration.h Просмотреть файл

@@ -387,7 +387,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
387 387
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
388 388
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
389 389
 
390
-#if defined(MESH_BED_LEVELING)
390
+#ifdef MESH_BED_LEVELING
391 391
   #define MESH_MIN_X 10
392 392
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
393 393
   #define MESH_MIN_Y 10
@@ -492,6 +492,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
492 492
 
493 493
   #endif
494 494
 
495
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
496
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
497
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
498
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
499
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
500
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
501
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
502
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
503
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
504
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
505
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
506
+
507
+  //#define Z_PROBE_ENDSTOP
508
+
495 509
 #endif // ENABLE_AUTO_BED_LEVELING
496 510
 
497 511
 

+ 3
- 3
Marlin/example_configurations/Hephestos/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 2
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 2
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 15
- 1
Marlin/example_configurations/K8200/Configuration.h Просмотреть файл

@@ -392,7 +392,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
392 392
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
393 393
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
394 394
 
395
-#if defined(MESH_BED_LEVELING)
395
+#ifdef MESH_BED_LEVELING
396 396
   #define MESH_MIN_X 10
397 397
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
398 398
   #define MESH_MIN_Y 10
@@ -497,6 +497,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
497 497
 
498 498
   #endif
499 499
 
500
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
501
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
502
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
503
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
504
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
505
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
506
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
507
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
508
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
509
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
510
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
511
+
512
+  //#define Z_PROBE_ENDSTOP
513
+
500 514
 #endif // ENABLE_AUTO_BED_LEVELING
501 515
 
502 516
 

+ 3
- 3
Marlin/example_configurations/K8200/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 3
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 3
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 15
- 1
Marlin/example_configurations/SCARA/Configuration.h Просмотреть файл

@@ -416,7 +416,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
416 416
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
417 417
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
418 418
 
419
-#if defined(MESH_BED_LEVELING)
419
+#ifdef MESH_BED_LEVELING
420 420
   #define MESH_MIN_X 10
421 421
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
422 422
   #define MESH_MIN_Y 10
@@ -521,6 +521,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
521 521
 
522 522
   #endif
523 523
 
524
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
525
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
526
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
527
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
528
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
529
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
530
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
531
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
532
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
533
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
534
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
535
+
536
+  //#define Z_PROBE_ENDSTOP
537
+
524 538
 #endif // ENABLE_AUTO_BED_LEVELING
525 539
 
526 540
 

+ 3
- 3
Marlin/example_configurations/SCARA/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 3
179
-#define Y_HOME_RETRACT_MM 3
180
-#define Z_HOME_RETRACT_MM 3
178
+#define X_HOME_BUMP_MM 3
179
+#define Y_HOME_BUMP_MM 3
180
+#define Z_HOME_BUMP_MM 3
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 15
- 1
Marlin/example_configurations/WITBOX/Configuration.h Просмотреть файл

@@ -386,7 +386,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
386 386
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
387 387
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
388 388
 
389
-#if defined(MESH_BED_LEVELING)
389
+#ifdef MESH_BED_LEVELING
390 390
   #define MESH_MIN_X 10
391 391
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
392 392
   #define MESH_MIN_Y 10
@@ -491,6 +491,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
491 491
 
492 492
   #endif
493 493
 
494
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
495
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
496
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
497
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
498
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
500
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
501
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
502
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
503
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
504
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
505
+
506
+  //#define Z_PROBE_ENDSTOP
507
+
494 508
 #endif // ENABLE_AUTO_BED_LEVELING
495 509
 
496 510
 

+ 3
- 3
Marlin/example_configurations/WITBOX/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 2
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 2
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 19
- 5
Marlin/example_configurations/delta/generic/Configuration.h Просмотреть файл

@@ -414,7 +414,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
414 414
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
415 415
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
416 416
 
417
-#if defined(MESH_BED_LEVELING)
417
+#ifdef MESH_BED_LEVELING
418 418
   #define MESH_MIN_X 10
419 419
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
420 420
   #define MESH_MIN_Y 10
@@ -507,10 +507,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
507 507
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
508 508
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100
509 509
     
510
-    #define Z_PROBE_ALLEN_KEY_RETRACT_X     -64
511
-    #define Z_PROBE_ALLEN_KEY_RETRACT_Y     56
512
-    #define Z_PROBE_ALLEN_KEY_RETRACT_Z     23
513
-    #define Z_PROBE_ALLEN_KEY_RETRACT_DEPTH 20
510
+    #define Z_PROBE_ALLEN_KEY_STOW_X     -64
511
+    #define Z_PROBE_ALLEN_KEY_STOW_Y     56
512
+    #define Z_PROBE_ALLEN_KEY_STOW_Z     23
513
+    #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
514 514
   #endif
515 515
   
516 516
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
@@ -537,6 +537,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
537 537
 
538 538
   #endif
539 539
 
540
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
541
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
542
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
543
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
544
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
545
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
546
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
547
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
548
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
549
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
550
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
551
+
552
+  //#define Z_PROBE_ENDSTOP
553
+
540 554
 #endif // ENABLE_AUTO_BED_LEVELING
541 555
 
542 556
 

+ 3
- 3
Marlin/example_configurations/delta/generic/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 5 // deltas need the same for all three axis
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 19
- 5
Marlin/example_configurations/delta/kossel_mini/Configuration.h Просмотреть файл

@@ -414,7 +414,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
414 414
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
415 415
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
416 416
 
417
-#if defined(MESH_BED_LEVELING)
417
+#ifdef MESH_BED_LEVELING
418 418
   #define MESH_MIN_X 10
419 419
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
420 420
   #define MESH_MIN_Y 10
@@ -511,10 +511,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
511 511
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
512 512
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100
513 513
     
514
-    #define Z_PROBE_ALLEN_KEY_RETRACT_X     -64
515
-    #define Z_PROBE_ALLEN_KEY_RETRACT_Y     56
516
-    #define Z_PROBE_ALLEN_KEY_RETRACT_Z     23
517
-    #define Z_PROBE_ALLEN_KEY_RETRACT_DEPTH 20
514
+    #define Z_PROBE_ALLEN_KEY_STOW_X     -64
515
+    #define Z_PROBE_ALLEN_KEY_STOW_Y     56
516
+    #define Z_PROBE_ALLEN_KEY_STOW_Z     23
517
+    #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
518 518
   #endif
519 519
   
520 520
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
@@ -541,6 +541,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
541 541
 
542 542
   #endif
543 543
 
544
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
545
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
546
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
547
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
548
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
549
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
550
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
551
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
552
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
553
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
554
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
555
+
556
+  //#define Z_PROBE_ENDSTOP
557
+
544 558
 #endif // ENABLE_AUTO_BED_LEVELING
545 559
 
546 560
 

+ 3
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 5 // deltas need the same for all three axis
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 15
- 1
Marlin/example_configurations/makibox/Configuration.h Просмотреть файл

@@ -384,7 +384,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
384 384
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
385 385
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
386 386
 
387
-#if defined(MESH_BED_LEVELING)
387
+#ifdef MESH_BED_LEVELING
388 388
   #define MESH_MIN_X 10
389 389
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
390 390
   #define MESH_MIN_Y 10
@@ -489,6 +489,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
489 489
 
490 490
   #endif
491 491
 
492
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
493
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
494
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
495
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
496
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
497
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
498
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
499
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
500
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
501
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
502
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
503
+
504
+  //#define Z_PROBE_ENDSTOP
505
+
492 506
 #endif // ENABLE_AUTO_BED_LEVELING
493 507
 
494 508
 

+ 3
- 3
Marlin/example_configurations/makibox/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 2
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 2
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 15
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h Просмотреть файл

@@ -386,7 +386,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
386 386
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
387 387
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
388 388
 
389
-#if defined(MESH_BED_LEVELING)
389
+#ifdef MESH_BED_LEVELING
390 390
   #define MESH_MIN_X 10
391 391
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
392 392
   #define MESH_MIN_Y 10
@@ -491,6 +491,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
491 491
 
492 492
   #endif
493 493
 
494
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
495
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
496
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
497
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
498
+  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
500
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
501
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
502
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
503
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
504
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
505
+
506
+  //#define Z_PROBE_ENDSTOP
507
+
494 508
 #endif // ENABLE_AUTO_BED_LEVELING
495 509
 
496 510
 

+ 3
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h Просмотреть файл

@@ -175,9 +175,9 @@
175 175
 #endif //DUAL_X_CARRIAGE
176 176
 
177 177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
178
-#define X_HOME_RETRACT_MM 5
179
-#define Y_HOME_RETRACT_MM 5
180
-#define Z_HOME_RETRACT_MM 1
178
+#define X_HOME_BUMP_MM 5
179
+#define Y_HOME_BUMP_MM 5
180
+#define Z_HOME_BUMP_MM 1
181 181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182 182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
183 183
 

+ 1
- 1
Marlin/mesh_bed_leveling.h Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 #include "Marlin.h"
2 2
 
3
-#if defined(MESH_BED_LEVELING)
3
+#ifdef MESH_BED_LEVELING
4 4
 
5 5
   #define MESH_X_DIST ((MESH_MAX_X - MESH_MIN_X)/(MESH_NUM_X_POINTS - 1))
6 6
   #define MESH_Y_DIST ((MESH_MAX_Y - MESH_MIN_Y)/(MESH_NUM_Y_POINTS - 1))

+ 3
- 3
Marlin/planner.cpp Просмотреть файл

@@ -58,7 +58,7 @@
58 58
 #include "ultralcd.h"
59 59
 #include "language.h"
60 60
 
61
-#if defined(MESH_BED_LEVELING)
61
+#ifdef MESH_BED_LEVELING
62 62
   #include "mesh_bed_leveling.h"
63 63
 #endif  // MESH_BED_LEVELING
64 64
 
@@ -454,10 +454,10 @@ void check_axes_activity() {
454 454
   #endif
455 455
 
456 456
   #ifdef BARICUDA
457
-    #if defined(HEATER_1_PIN) && HEATER_1_PIN > -1 // HAS_HEATER_1
457
+    #if HAS_HEATER_1
458 458
       analogWrite(HEATER_1_PIN,tail_valve_pressure);
459 459
     #endif
460
-    #if defined(HEATER_2_PIN) && HEATER_2_PIN > -1 // HAS_HEATER_2
460
+    #if HAS_HEATER_2
461 461
       analogWrite(HEATER_2_PIN,tail_e_to_p_pressure);
462 462
     #endif
463 463
   #endif

+ 58
- 58
Marlin/stepper.cpp Просмотреть файл

@@ -86,29 +86,29 @@ static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_P
86 86
   int motor_current_setting[3] = DEFAULT_PWM_MOTOR_CURRENT;
87 87
 #endif
88 88
 
89
-#if defined(X_MIN_PIN) && X_MIN_PIN >= 0
89
+#if HAS_X_MIN
90 90
   static bool old_x_min_endstop = false;
91 91
 #endif
92
-#if defined(X_MAX_PIN) && X_MAX_PIN >= 0
92
+#if HAS_X_MAX
93 93
   static bool old_x_max_endstop = false;
94 94
 #endif
95
-#if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
95
+#if HAS_Y_MIN
96 96
   static bool old_y_min_endstop = false;
97 97
 #endif
98
-#if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
98
+#if HAS_Y_MAX
99 99
   static bool old_y_max_endstop = false;
100 100
 #endif
101
-#if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
101
+#if HAS_Z_MIN
102 102
   static bool old_z_min_endstop = false;
103 103
 #endif
104
-#if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
104
+#if HAS_Z_MAX
105 105
   static bool old_z_max_endstop = false;
106 106
 #endif
107 107
 #ifdef Z_DUAL_ENDSTOPS
108
-  #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
108
+  #if HAS_Z2_MIN
109 109
     static bool old_z2_min_endstop = false;
110 110
   #endif
111
-  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
111
+  #if HAS_Z2_MAX
112 112
     static bool old_z2_max_endstop = false;
113 113
   #endif
114 114
 #endif
@@ -483,7 +483,7 @@ ISR(TIMER1_COMPA_vect) {
483 483
               if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
484 484
             #endif          
485 485
               {
486
-                #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
486
+                #if HAS_X_MIN
487 487
                   UPDATE_ENDSTOP(x, X, min, MIN);
488 488
                 #endif
489 489
               }
@@ -494,7 +494,7 @@ ISR(TIMER1_COMPA_vect) {
494 494
               if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
495 495
             #endif
496 496
               {
497
-                #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
497
+                #if HAS_X_MAX
498 498
                   UPDATE_ENDSTOP(x, X, max, MAX);
499 499
                 #endif
500 500
               }
@@ -509,12 +509,12 @@ ISR(TIMER1_COMPA_vect) {
509 509
           if (TEST(out_bits, Y_AXIS))   // -direction
510 510
       #endif
511 511
           { // -direction
512
-            #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
512
+            #if HAS_Y_MIN
513 513
               UPDATE_ENDSTOP(y, Y, min, MIN);
514 514
             #endif
515 515
           }
516 516
           else { // +direction
517
-            #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
517
+            #if HAS_Y_MAX
518 518
               UPDATE_ENDSTOP(y, Y, max, MAX);
519 519
             #endif
520 520
           }
@@ -530,13 +530,13 @@ ISR(TIMER1_COMPA_vect) {
530 530
 
531 531
       if (check_endstops) {
532 532
 
533
-        #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
533
+        #if HAS_Z_MIN
534 534
 
535 535
           #ifdef Z_DUAL_ENDSTOPS
536 536
 
537 537
             bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING,
538 538
                 z2_min_endstop =
539
-                  #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
539
+                  #if HAS_Z2_MIN
540 540
                     READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING
541 541
                   #else
542 542
                     z_min_endstop
@@ -585,13 +585,13 @@ ISR(TIMER1_COMPA_vect) {
585 585
 
586 586
       if (check_endstops) {
587 587
 
588
-        #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
588
+        #if HAS_Z_MAX
589 589
 
590 590
           #ifdef Z_DUAL_ENDSTOPS
591 591
 
592 592
             bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING,
593 593
                 z2_max_endstop =
594
-                  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
594
+                  #if HAS_Z2_MAX
595 595
                     READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING
596 596
                   #else
597 597
                     z_max_endstop
@@ -871,127 +871,127 @@ void st_init() {
871 871
   #endif
872 872
   
873 873
   // Initialize Dir Pins
874
-  #if defined(X_DIR_PIN) && X_DIR_PIN >= 0
874
+  #if HAS_X_DIR
875 875
     X_DIR_INIT;
876 876
   #endif
877
-  #if defined(X2_DIR_PIN) && X2_DIR_PIN >= 0
877
+  #if HAS_X2_DIR
878 878
     X2_DIR_INIT;
879 879
   #endif
880
-  #if defined(Y_DIR_PIN) && Y_DIR_PIN >= 0
880
+  #if HAS_Y_DIR
881 881
     Y_DIR_INIT;
882
-    #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_DIR_PIN) && Y2_DIR_PIN >= 0
882
+    #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_DIR
883 883
       Y2_DIR_INIT;
884 884
     #endif
885 885
   #endif
886
-  #if defined(Z_DIR_PIN) && Z_DIR_PIN >= 0
886
+  #if HAS_Z_DIR
887 887
     Z_DIR_INIT;
888
-    #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_DIR_PIN) && Z2_DIR_PIN >= 0
888
+    #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_DIR
889 889
       Z2_DIR_INIT;
890 890
     #endif
891 891
   #endif
892
-  #if defined(E0_DIR_PIN) && E0_DIR_PIN >= 0
892
+  #if HAS_E0_DIR
893 893
     E0_DIR_INIT;
894 894
   #endif
895
-  #if defined(E1_DIR_PIN) && E1_DIR_PIN >= 0
895
+  #if HAS_E1_DIR
896 896
     E1_DIR_INIT;
897 897
   #endif
898
-  #if defined(E2_DIR_PIN) && E2_DIR_PIN >= 0
898
+  #if HAS_E2_DIR
899 899
     E2_DIR_INIT;
900 900
   #endif
901
-  #if defined(E3_DIR_PIN) && E3_DIR_PIN >= 0
901
+  #if HAS_E3_DIR
902 902
     E3_DIR_INIT;
903 903
   #endif
904 904
 
905 905
   //Initialize Enable Pins - steppers default to disabled.
906 906
 
907
-  #if defined(X_ENABLE_PIN) && X_ENABLE_PIN >= 0
907
+  #if HAS_X_ENABLE
908 908
     X_ENABLE_INIT;
909 909
     if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH);
910 910
   #endif
911
-  #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN >= 0
911
+  #if HAS_X2_ENABLE
912 912
     X2_ENABLE_INIT;
913 913
     if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH);
914 914
   #endif
915
-  #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN >= 0
915
+  #if HAS_Y_ENABLE
916 916
     Y_ENABLE_INIT;
917 917
     if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH);
918 918
 	
919
-	#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_ENABLE_PIN) && Y2_ENABLE_PIN >= 0
919
+	#if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE
920 920
 	  Y2_ENABLE_INIT;
921 921
 	  if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH);
922 922
 	#endif
923 923
   #endif
924
-  #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN >= 0
924
+  #if HAS_Z_ENABLE
925 925
     Z_ENABLE_INIT;
926 926
     if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH);
927 927
 
928
-    #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_ENABLE_PIN) && Z2_ENABLE_PIN >= 0
928
+    #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_ENABLE
929 929
       Z2_ENABLE_INIT;
930 930
       if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH);
931 931
     #endif
932 932
   #endif
933
-  #if defined(E0_ENABLE_PIN) && E0_ENABLE_PIN >= 0
933
+  #if HAS_E0_ENABLE
934 934
     E0_ENABLE_INIT;
935 935
     if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH);
936 936
   #endif
937
-  #if defined(E1_ENABLE_PIN) && E1_ENABLE_PIN >= 0
937
+  #if HAS_E1_ENABLE
938 938
     E1_ENABLE_INIT;
939 939
     if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH);
940 940
   #endif
941
-  #if defined(E2_ENABLE_PIN) && E2_ENABLE_PIN >= 0
941
+  #if HAS_E2_ENABLE
942 942
     E2_ENABLE_INIT;
943 943
     if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH);
944 944
   #endif
945
-  #if defined(E3_ENABLE_PIN) && E3_ENABLE_PIN >= 0
945
+  #if HAS_E3_ENABLE
946 946
     E3_ENABLE_INIT;
947 947
     if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH);
948 948
   #endif
949 949
 
950 950
   //endstops and pullups
951 951
 
952
-  #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
952
+  #if HAS_X_MIN
953 953
     SET_INPUT(X_MIN_PIN);
954 954
     #ifdef ENDSTOPPULLUP_XMIN
955 955
       WRITE(X_MIN_PIN,HIGH);
956 956
     #endif
957 957
   #endif
958 958
 
959
-  #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
959
+  #if HAS_Y_MIN
960 960
     SET_INPUT(Y_MIN_PIN);
961 961
     #ifdef ENDSTOPPULLUP_YMIN
962 962
       WRITE(Y_MIN_PIN,HIGH);
963 963
     #endif
964 964
   #endif
965 965
 
966
-  #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
966
+  #if HAS_Z_MIN
967 967
     SET_INPUT(Z_MIN_PIN);
968 968
     #ifdef ENDSTOPPULLUP_ZMIN
969 969
       WRITE(Z_MIN_PIN,HIGH);
970 970
     #endif
971 971
   #endif
972 972
 
973
-  #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
973
+  #if HAS_X_MAX
974 974
     SET_INPUT(X_MAX_PIN);
975 975
     #ifdef ENDSTOPPULLUP_XMAX
976 976
       WRITE(X_MAX_PIN,HIGH);
977 977
     #endif
978 978
   #endif
979 979
 
980
-  #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
980
+  #if HAS_Y_MAX
981 981
     SET_INPUT(Y_MAX_PIN);
982 982
     #ifdef ENDSTOPPULLUP_YMAX
983 983
       WRITE(Y_MAX_PIN,HIGH);
984 984
     #endif
985 985
   #endif
986 986
 
987
-  #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
987
+  #if HAS_Z_MAX
988 988
     SET_INPUT(Z_MAX_PIN);
989 989
     #ifdef ENDSTOPPULLUP_ZMAX
990 990
       WRITE(Z_MAX_PIN,HIGH);
991 991
     #endif
992 992
   #endif
993 993
 
994
-  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
994
+  #if HAS_Z2_MAX
995 995
     SET_INPUT(Z2_MAX_PIN);
996 996
     #ifdef ENDSTOPPULLUP_ZMAX
997 997
       WRITE(Z2_MAX_PIN,HIGH);
@@ -1013,36 +1013,36 @@ void st_init() {
1013 1013
   #define E_AXIS_INIT(NUM) AXIS_INIT(e## NUM, E## NUM, E)
1014 1014
 
1015 1015
   // Initialize Step Pins
1016
-  #if defined(X_STEP_PIN) && X_STEP_PIN >= 0
1016
+  #if HAS_X_STEP
1017 1017
     AXIS_INIT(x, X, X);
1018 1018
   #endif
1019
-  #if defined(X2_STEP_PIN) && X2_STEP_PIN >= 0
1019
+  #if HAS_X2_STEP
1020 1020
     AXIS_INIT(x, X2, X);
1021 1021
   #endif
1022
-  #if defined(Y_STEP_PIN) && Y_STEP_PIN >= 0
1023
-    #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && Y2_STEP_PIN >= 0
1022
+  #if HAS_Y_STEP
1023
+    #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_STEP
1024 1024
       Y2_STEP_INIT;
1025 1025
       Y2_STEP_WRITE(INVERT_Y_STEP_PIN);
1026 1026
     #endif
1027 1027
     AXIS_INIT(y, Y, Y);
1028 1028
   #endif
1029
-  #if defined(Z_STEP_PIN) && Z_STEP_PIN >= 0
1030
-    #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_STEP_PIN) && Z2_STEP_PIN >= 0
1029
+  #if HAS_Z_STEP
1030
+    #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_STEP
1031 1031
       Z2_STEP_INIT;
1032 1032
       Z2_STEP_WRITE(INVERT_Z_STEP_PIN);
1033 1033
     #endif
1034 1034
     AXIS_INIT(z, Z, Z);
1035 1035
   #endif
1036
-  #if defined(E0_STEP_PIN) && E0_STEP_PIN >= 0
1036
+  #if HAS_E0_STEP
1037 1037
     E_AXIS_INIT(0);
1038 1038
   #endif
1039
-  #if defined(E1_STEP_PIN) && E1_STEP_PIN >= 0
1039
+  #if HAS_E1_STEP
1040 1040
     E_AXIS_INIT(1);
1041 1041
   #endif
1042
-  #if defined(E2_STEP_PIN) && E2_STEP_PIN >= 0
1042
+  #if HAS_E2_STEP
1043 1043
     E_AXIS_INIT(2);
1044 1044
   #endif
1045
-  #if defined(E3_STEP_PIN) && E3_STEP_PIN >= 0
1045
+  #if HAS_E3_STEP
1046 1046
     E_AXIS_INIT(3);
1047 1047
   #endif
1048 1048
 
@@ -1263,12 +1263,12 @@ void digipot_current(uint8_t driver, int current) {
1263 1263
 }
1264 1264
 
1265 1265
 void microstep_init() {
1266
-  #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0
1266
+  #if HAS_MICROSTEPS_E1
1267 1267
     pinMode(E1_MS1_PIN,OUTPUT);
1268
-    pinMode(E1_MS2_PIN,OUTPUT); 
1268
+    pinMode(E1_MS2_PIN,OUTPUT);
1269 1269
   #endif
1270 1270
 
1271
-  #if defined(X_MS1_PIN) && X_MS1_PIN >= 0
1271
+  #if HAS_MICROSTEPS
1272 1272
     pinMode(X_MS1_PIN,OUTPUT);
1273 1273
     pinMode(X_MS2_PIN,OUTPUT);  
1274 1274
     pinMode(Y_MS1_PIN,OUTPUT);
@@ -1289,7 +1289,7 @@ void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) {
1289 1289
     case 1: digitalWrite(Y_MS1_PIN, ms1); break;
1290 1290
     case 2: digitalWrite(Z_MS1_PIN, ms1); break;
1291 1291
     case 3: digitalWrite(E0_MS1_PIN, ms1); break;
1292
-    #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0
1292
+    #if HAS_MICROSTEPS_E1
1293 1293
       case 4: digitalWrite(E1_MS1_PIN, ms1); break;
1294 1294
     #endif
1295 1295
   }
@@ -1328,7 +1328,7 @@ void microstep_readings() {
1328 1328
   SERIAL_PROTOCOLPGM("E0: ");
1329 1329
   SERIAL_PROTOCOL(digitalRead(E0_MS1_PIN));
1330 1330
   SERIAL_PROTOCOLLN(digitalRead(E0_MS2_PIN));
1331
-  #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0
1331
+  #if HAS_MICROSTEPS_E1
1332 1332
     SERIAL_PROTOCOLPGM("E1: ");
1333 1333
     SERIAL_PROTOCOL(digitalRead(E1_MS1_PIN));
1334 1334
     SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN));

+ 1
- 1
Marlin/temperature.h Просмотреть файл

@@ -53,7 +53,7 @@ extern float current_temperature_bed;
53 53
   extern float redundant_temperature;
54 54
 #endif
55 55
 
56
-#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
56
+#if HAS_CONTROLLERFAN
57 57
   extern unsigned char soft_pwm_bed;
58 58
 #endif
59 59
 

+ 8
- 8
Marlin/ultralcd.h Просмотреть файл

@@ -64,14 +64,14 @@
64 64
 
65 65
     #define LCD_CLICKED (buttons&EN_C)
66 66
     #ifdef REPRAPWORLD_KEYPAD
67
-  	  #define EN_REPRAPWORLD_KEYPAD_F3 BIT(BLEN_REPRAPWORLD_KEYPAD_F3)
68
-  	  #define EN_REPRAPWORLD_KEYPAD_F2 BIT(BLEN_REPRAPWORLD_KEYPAD_F2)
69
-  	  #define EN_REPRAPWORLD_KEYPAD_F1 BIT(BLEN_REPRAPWORLD_KEYPAD_F1)
70
-  	  #define EN_REPRAPWORLD_KEYPAD_UP BIT(BLEN_REPRAPWORLD_KEYPAD_UP)
71
-  	  #define EN_REPRAPWORLD_KEYPAD_RIGHT BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT)
72
-  	  #define EN_REPRAPWORLD_KEYPAD_MIDDLE BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
73
-  	  #define EN_REPRAPWORLD_KEYPAD_DOWN BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN)
74
-  	  #define EN_REPRAPWORLD_KEYPAD_LEFT BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT)
67
+  	  #define EN_REPRAPWORLD_KEYPAD_F3 (BIT(BLEN_REPRAPWORLD_KEYPAD_F3))
68
+  	  #define EN_REPRAPWORLD_KEYPAD_F2 (BIT(BLEN_REPRAPWORLD_KEYPAD_F2))
69
+  	  #define EN_REPRAPWORLD_KEYPAD_F1 (BIT(BLEN_REPRAPWORLD_KEYPAD_F1))
70
+  	  #define EN_REPRAPWORLD_KEYPAD_UP (BIT(BLEN_REPRAPWORLD_KEYPAD_UP))
71
+  	  #define EN_REPRAPWORLD_KEYPAD_RIGHT (BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT))
72
+  	  #define EN_REPRAPWORLD_KEYPAD_MIDDLE (BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
73
+  	  #define EN_REPRAPWORLD_KEYPAD_DOWN (BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN))
74
+  	  #define EN_REPRAPWORLD_KEYPAD_LEFT (BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT))
75 75
 
76 76
   	  #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
77 77
   	  #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)

Загрузка…
Отмена
Сохранить