Browse Source

Upstream commits, allow no extruder in M105

Scott Lahteine 9 years ago
parent
commit
713953d8c1
34 changed files with 826 additions and 671 deletions
  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 View File

10
 
10
 
11
 #ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
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
   #define CONFIGURATION_LCD
15
   #define CONFIGURATION_LCD
14
 
16
 
15
   #if defined(MAKRPANEL)
17
   #if defined(MAKRPANEL)
279
     #define PS_ON_AWAKE  HIGH
281
     #define PS_ON_AWAKE  HIGH
280
     #define PS_ON_ASLEEP LOW
282
     #define PS_ON_ASLEEP LOW
281
   #endif
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
    * Temp Sensor defines
287
    * Temp Sensor defines
350
   #endif
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
   #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
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
    * Helper Macros for heaters and extruder fan
432
    * Helper Macros for heaters and extruder fan

+ 14
- 14
Marlin/Configuration.h View File

394
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
394
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
395
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
395
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
396
 
396
 
397
-#if defined(MESH_BED_LEVELING)
397
+#ifdef MESH_BED_LEVELING
398
   #define MESH_MIN_X 10
398
   #define MESH_MIN_X 10
399
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
399
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
400
   #define MESH_MIN_Y 10
400
   #define MESH_MIN_Y 10
499
 
499
 
500
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
516
 #endif // ENABLE_AUTO_BED_LEVELING
517
 
517
 
691
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
691
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
692
 // #define PHOTOGRAPH_PIN     23
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
 //#define SF_ARC_FIX
695
 //#define SF_ARC_FIX
696
 
696
 
697
 // Support for the BariCUDA Paste Extruder.
697
 // Support for the BariCUDA Paste Extruder.

+ 2
- 2
Marlin/ConfigurationStore.cpp View File

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

+ 3
- 3
Marlin/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {2, 2, 4}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {2, 2, 4}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

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

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


+ 21
- 3
Marlin/SanityCheck.h View File

56
   #if EXTRUDERS > 1
56
   #if EXTRUDERS > 1
57
 
57
 
58
     #if EXTRUDERS > 4
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
     #endif
60
     #endif
61
 
61
 
62
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
62
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
78
   #endif // EXTRUDERS > 1
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
    * Required LCD language
88
    * Required LCD language
82
    */
89
    */
83
   #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)
90
   #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)
235
    */
242
    */
236
   #ifdef DUAL_X_CARRIAGE
243
   #ifdef DUAL_X_CARRIAGE
237
     #if EXTRUDERS == 1 || defined(COREXY) \
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
         || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
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
       #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
248
       #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
242
     #endif
249
     #endif
243
     #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
250
     #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
260
     #endif
267
     #endif
261
   #endif
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
    * Test required HEATER defines
275
    * Test required HEATER defines
265
    */
276
    */
280
     #error HEATER_0_PIN not defined for this board
291
     #error HEATER_0_PIN not defined for this board
281
   #endif
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
 #endif //SANITYCHECK_H
301
 #endif //SANITYCHECK_H

+ 15
- 1
Marlin/configurator/config/Configuration.h View File

412
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
412
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
413
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
413
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
414
 
414
 
415
-#if defined(MESH_BED_LEVELING)
415
+#ifdef MESH_BED_LEVELING
416
   #define MESH_MIN_X 10
416
   #define MESH_MIN_X 10
417
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
417
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
418
   #define MESH_MIN_Y 10
418
   #define MESH_MIN_Y 10
519
 
519
 
520
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
536
 #endif // ENABLE_AUTO_BED_LEVELING
523
 
537
 
524
 
538
 

+ 3
- 3
Marlin/configurator/config/Configuration_adv.h View File

189
 // @section homing
189
 // @section homing
190
 
190
 
191
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
195
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
196
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

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

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

364
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
364
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
365
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
365
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
366
 
366
 
367
-#if defined(MESH_BED_LEVELING)
367
+#ifdef MESH_BED_LEVELING
368
   #define MESH_MIN_X 10
368
   #define MESH_MIN_X 10
369
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
369
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
370
   #define MESH_MIN_Y 10
370
   #define MESH_MIN_Y 10
469
 
469
 
470
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
486
 #endif // ENABLE_AUTO_BED_LEVELING
473
 
487
 
474
 
488
 

+ 15
- 1
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

364
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
364
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
365
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
365
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
366
 
366
 
367
-#if defined(MESH_BED_LEVELING)
367
+#ifdef MESH_BED_LEVELING
368
   #define MESH_MIN_X 10
368
   #define MESH_MIN_X 10
369
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
369
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
370
   #define MESH_MIN_Y 10
370
   #define MESH_MIN_Y 10
469
 
469
 
470
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
486
 #endif // ENABLE_AUTO_BED_LEVELING
473
 
487
 
474
 
488
 

+ 3
- 3
Marlin/example_configurations/Felix/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

387
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
387
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
388
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
388
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
389
 
389
 
390
-#if defined(MESH_BED_LEVELING)
390
+#ifdef MESH_BED_LEVELING
391
   #define MESH_MIN_X 10
391
   #define MESH_MIN_X 10
392
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
392
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
393
   #define MESH_MIN_Y 10
393
   #define MESH_MIN_Y 10
492
 
492
 
493
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
509
 #endif // ENABLE_AUTO_BED_LEVELING
496
 
510
 
497
 
511
 

+ 3
- 3
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

392
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
392
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
393
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
393
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
394
 
394
 
395
-#if defined(MESH_BED_LEVELING)
395
+#ifdef MESH_BED_LEVELING
396
   #define MESH_MIN_X 10
396
   #define MESH_MIN_X 10
397
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
397
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
398
   #define MESH_MIN_Y 10
398
   #define MESH_MIN_Y 10
497
 
497
 
498
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
514
 #endif // ENABLE_AUTO_BED_LEVELING
501
 
515
 
502
 
516
 

+ 3
- 3
Marlin/example_configurations/K8200/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

416
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
416
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
417
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
417
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
418
 
418
 
419
-#if defined(MESH_BED_LEVELING)
419
+#ifdef MESH_BED_LEVELING
420
   #define MESH_MIN_X 10
420
   #define MESH_MIN_X 10
421
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
421
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
422
   #define MESH_MIN_Y 10
422
   #define MESH_MIN_Y 10
521
 
521
 
522
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
538
 #endif // ENABLE_AUTO_BED_LEVELING
525
 
539
 
526
 
540
 

+ 3
- 3
Marlin/example_configurations/SCARA/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

386
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
386
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
387
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
387
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
388
 
388
 
389
-#if defined(MESH_BED_LEVELING)
389
+#ifdef MESH_BED_LEVELING
390
   #define MESH_MIN_X 10
390
   #define MESH_MIN_X 10
391
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
391
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
392
   #define MESH_MIN_Y 10
392
   #define MESH_MIN_Y 10
491
 
491
 
492
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
508
 #endif // ENABLE_AUTO_BED_LEVELING
495
 
509
 
496
 
510
 

+ 3
- 3
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

414
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
414
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
415
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
415
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
416
 
416
 
417
-#if defined(MESH_BED_LEVELING)
417
+#ifdef MESH_BED_LEVELING
418
   #define MESH_MIN_X 10
418
   #define MESH_MIN_X 10
419
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
419
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
420
   #define MESH_MIN_Y 10
420
   #define MESH_MIN_Y 10
507
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
507
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
508
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100
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
   #endif
514
   #endif
515
   
515
   
516
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
516
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
537
 
537
 
538
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
554
 #endif // ENABLE_AUTO_BED_LEVELING
541
 
555
 
542
 
556
 

+ 3
- 3
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

414
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
414
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
415
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
415
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
416
 
416
 
417
-#if defined(MESH_BED_LEVELING)
417
+#ifdef MESH_BED_LEVELING
418
   #define MESH_MIN_X 10
418
   #define MESH_MIN_X 10
419
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
419
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
420
   #define MESH_MIN_Y 10
420
   #define MESH_MIN_Y 10
511
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
511
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
512
     #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100
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
   #endif
518
   #endif
519
   
519
   
520
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
520
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
541
 
541
 
542
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
558
 #endif // ENABLE_AUTO_BED_LEVELING
545
 
559
 
546
 
560
 

+ 3
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

384
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
384
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
385
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
385
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
386
 
386
 
387
-#if defined(MESH_BED_LEVELING)
387
+#ifdef MESH_BED_LEVELING
388
   #define MESH_MIN_X 10
388
   #define MESH_MIN_X 10
389
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
389
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
390
   #define MESH_MIN_Y 10
390
   #define MESH_MIN_Y 10
489
 
489
 
490
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
506
 #endif // ENABLE_AUTO_BED_LEVELING
493
 
507
 
494
 
508
 

+ 3
- 3
Marlin/example_configurations/makibox/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

386
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
386
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
387
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
387
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
388
 
388
 
389
-#if defined(MESH_BED_LEVELING)
389
+#ifdef MESH_BED_LEVELING
390
   #define MESH_MIN_X 10
390
   #define MESH_MIN_X 10
391
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
391
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
392
   #define MESH_MIN_Y 10
392
   #define MESH_MIN_Y 10
491
 
491
 
492
   #endif
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
 #endif // ENABLE_AUTO_BED_LEVELING
508
 #endif // ENABLE_AUTO_BED_LEVELING
495
 
509
 
496
 
510
 

+ 3
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

175
 #endif //DUAL_X_CARRIAGE
175
 #endif //DUAL_X_CARRIAGE
176
 
176
 
177
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
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
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
181
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
182
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
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 View File

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

+ 3
- 3
Marlin/planner.cpp View File

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

+ 58
- 58
Marlin/stepper.cpp View File

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

+ 1
- 1
Marlin/temperature.h View File

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

+ 8
- 8
Marlin/ultralcd.h View File

64
 
64
 
65
     #define LCD_CLICKED (buttons&EN_C)
65
     #define LCD_CLICKED (buttons&EN_C)
66
     #ifdef REPRAPWORLD_KEYPAD
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
   	  #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
76
   	  #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
77
   	  #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
77
   	  #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)

Loading…
Cancel
Save