Browse Source

Merge branch 'Development-Marlin' into Development

Conflicts:
	Marlin/Configuration.h
	Marlin/Marlin_main.cpp
Edward Patel 10 years ago
parent
commit
ea10601406
50 changed files with 1595 additions and 1175 deletions
  1. 9
    0
      .gitignore
  2. 1
    0
      ArduinoAddons/Arduino_1.5.x/hardware/marlin/avr/platform.local.txt
  3. 79
    18
      Marlin/Conditionals.h
  4. 29
    6
      Marlin/Configuration.h
  5. 77
    33
      Marlin/ConfigurationStore.cpp
  6. 3
    3
      Marlin/Configuration_adv.h
  7. 54
    37
      Marlin/Marlin.h
  8. 3
    5
      Marlin/MarlinSerial.cpp
  9. 2
    2
      Marlin/MarlinSerial.h
  10. 729
    734
      Marlin/Marlin_main.cpp
  11. 51
    7
      Marlin/SanityCheck.h
  12. 1
    1
      Marlin/Servo.h
  13. 1
    0
      Marlin/boards.h
  14. 6
    6
      Marlin/cardreader.cpp
  15. 19
    3
      Marlin/configurator/config/Configuration.h
  16. 3
    3
      Marlin/configurator/config/Configuration_adv.h
  17. 1
    1
      Marlin/dogm_lcd_implementation.h
  18. 19
    3
      Marlin/example_configurations/Felix/Configuration.h
  19. 19
    3
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  20. 3
    3
      Marlin/example_configurations/Felix/Configuration_adv.h
  21. 19
    3
      Marlin/example_configurations/Hephestos/Configuration.h
  22. 3
    3
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  23. 19
    3
      Marlin/example_configurations/K8200/Configuration.h
  24. 3
    3
      Marlin/example_configurations/K8200/Configuration_adv.h
  25. 19
    3
      Marlin/example_configurations/SCARA/Configuration.h
  26. 3
    3
      Marlin/example_configurations/SCARA/Configuration_adv.h
  27. 19
    3
      Marlin/example_configurations/WITBOX/Configuration.h
  28. 3
    3
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  29. 23
    7
      Marlin/example_configurations/delta/generic/Configuration.h
  30. 3
    3
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  31. 23
    7
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  32. 3
    3
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  33. 19
    3
      Marlin/example_configurations/makibox/Configuration.h
  34. 3
    3
      Marlin/example_configurations/makibox/Configuration_adv.h
  35. 19
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  36. 3
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  37. 5
    5
      Marlin/fastio.h
  38. 29
    10
      Marlin/language.h
  39. 1
    1
      Marlin/mesh_bed_leveling.h
  40. 9
    2
      Marlin/pins.h
  41. 6
    1
      Marlin/pins_AZTEEG_X3_PRO.h
  42. 7
    1
      Marlin/pins_RAMPS_13.h
  43. 9
    9
      Marlin/planner.cpp
  44. 105
    68
      Marlin/stepper.cpp
  45. 70
    78
      Marlin/temperature.cpp
  46. 18
    32
      Marlin/temperature.h
  47. 26
    27
      Marlin/ultralcd.cpp
  48. 8
    8
      Marlin/ultralcd.h
  49. 2
    2
      Marlin/vector_3.cpp
  50. 7
    7
      README.md

+ 9
- 0
.gitignore View File

@@ -1,3 +1,12 @@
1
+// Our automatic versioning scheme generates the following file
2
+// NEVER put it in the repository
3
+_Version.h
4
+
5
+// All of the following OS, IDE and compiler generated file
6
+// references should be moved from this file
7
+// They are needed, but they belong in your global .gitignore
8
+// rather than in a per-project file such as this
9
+
1 10
 *.o
2 11
 applet/
3 12
 *~

+ 1
- 0
ArduinoAddons/Arduino_1.5.x/hardware/marlin/avr/platform.local.txt View File

@@ -0,0 +1 @@
1
+compiler.cpp.extra_flags=-DHAS_AUTOMATIC_VERSIONING

+ 79
- 18
Marlin/Conditionals.h View File

@@ -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)
@@ -189,6 +191,9 @@
189 191
       #define ENDSTOPPULLUP_YMIN
190 192
       #define ENDSTOPPULLUP_ZMIN
191 193
     #endif
194
+    #ifndef DISABLE_Z_PROBE_ENDSTOP
195
+      #define ENDSTOPPULLUP_ZPROBE
196
+    #endif
192 197
   #endif
193 198
 
194 199
   /**
@@ -276,7 +281,7 @@
276 281
     #define PS_ON_AWAKE  HIGH
277 282
     #define PS_ON_ASLEEP LOW
278 283
   #endif
279
-  #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))
280 285
 
281 286
   /**
282 287
    * Temp Sensor defines
@@ -347,25 +352,81 @@
347 352
   #endif
348 353
 
349 354
   /**
350
-   * Shorthand for pin tests, for temperature.cpp
355
+   * Shorthand for pin tests, used wherever needed
351 356
    */
352
-  #define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0 && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2)
353
-  #define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0 && TEMP_SENSOR_1 != 0)
354
-  #define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0 && TEMP_SENSOR_2 != 0)
355
-  #define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0 && TEMP_SENSOR_3 != 0)
356
-  #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0 && TEMP_SENSOR_BED != 0)
357
-  #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
358
-  #define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0)
359
-  #define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0)
360
-  #define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0)
361
-  #define HAS_HEATER_3 (defined(HEATER_3_PIN) && HEATER_3_PIN >= 0)
362
-  #define HAS_HEATER_BED (defined(HEATER_BED_PIN) && HEATER_BED_PIN >= 0)
363
-  #define HAS_AUTO_FAN_0 (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN >= 0)
364
-  #define HAS_AUTO_FAN_1 (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN >= 0)
365
-  #define HAS_AUTO_FAN_2 (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN >= 0)
366
-  #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))
367 371
   #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
368
-  #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))
369 430
 
370 431
   /**
371 432
    * Helper Macros for heaters and extruder fan

+ 29
- 6
Marlin/Configuration.h View File

@@ -31,7 +31,7 @@ Here are some standard links for getting your machine calibrated:
31 31
 //===========================================================================
32 32
 //============================= SCARA Printer ===============================
33 33
 //===========================================================================
34
-// For a Delta printer replace the configuration files with the files in the
34
+// For a Scara printer replace the configuration files with the files in the
35 35
 // example_configurations/SCARA directory.
36 36
 //
37 37
 
@@ -319,6 +319,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
319 319
   // #define ENDSTOPPULLUP_XMIN
320 320
   // #define ENDSTOPPULLUP_YMIN
321 321
   // #define ENDSTOPPULLUP_ZMIN
322
+  // #define ENDSTOPPULLUP_ZPROBE
322 323
 #endif
323 324
 
324 325
 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
@@ -328,8 +329,14 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
328 329
 const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
329 330
 const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
330 331
 const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
332
+const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
331 333
 //#define DISABLE_MAX_ENDSTOPS
332 334
 //#define DISABLE_MIN_ENDSTOPS
335
+// If you want to enable the Z Probe pin, but disable its use, uncomment the line below.
336
+// This only affects a Z Probe Endstop if you have separate Z min endstop as well and have
337
+// activated Z_PROBE_ENDSTOP below. If you are using the Z Min endstop on your Z Probe,
338
+// this has no effect.
339
+//#define DISABLE_Z_PROBE_ENDSTOP
333 340
 
334 341
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
335 342
 #define X_ENABLE_ON 0
@@ -387,11 +394,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
387 394
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
388 395
 // #define MESH_BED_LEVELING    // Enable mesh bed leveling
389 396
 
390
-#if defined(MANUAL_BED_LEVELING)
397
+#ifdef MANUAL_BED_LEVELING
391 398
   #define MBL_Z_STEP 0.025
392 399
 #endif  // MANUAL_BED_LEVELING
393 400
 
394
-#if defined(MESH_BED_LEVELING)
401
+#ifdef MESH_BED_LEVELING
395 402
   #define MESH_MIN_X 10
396 403
   #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
397 404
   #define MESH_MIN_Y 10
@@ -496,6 +503,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
496 503
 
497 504
   #endif
498 505
 
506
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
507
+  // 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.
508
+  // 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.
509
+  // 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.
510
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
511
+  // 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.
512
+  // 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
513
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
514
+  // 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.
515
+  // 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.
516
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
517
+
518
+  //#define Z_PROBE_ENDSTOP
519
+
499 520
 #endif // ENABLE_AUTO_BED_LEVELING
500 521
 
501 522
 
@@ -512,8 +533,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
512 533
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
513 534
 #endif
514 535
 
515
-//// MOVEMENT SETTINGS
516
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
536
+/**
537
+ * MOVEMENT SETTINGS
538
+ */
539
+
517 540
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
518 541
 
519 542
 // default settings
@@ -674,7 +697,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
674 697
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
675 698
 // #define PHOTOGRAPH_PIN     23
676 699
 
677
-// SF send wrong arc g-codes when using Arc Point as fillet procedure
700
+// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
678 701
 //#define SF_ARC_FIX
679 702
 
680 703
 // Support for the BariCUDA Paste Extruder.

+ 77
- 33
Marlin/ConfigurationStore.cpp View File

@@ -3,7 +3,21 @@
3 3
  *
4 4
  * Configuration and EEPROM storage
5 5
  *
6
- * V16 EEPROM Layout:
6
+ * IMPORTANT:  Whenever there are changes made to the variables stored in EEPROM
7
+ * in the functions below, also increment the version number. This makes sure that
8
+ * the default values are used whenever there is a change to the data, to prevent
9
+ * wrong data being written to the variables.
10
+ *
11
+ * ALSO: Variables in the Store and Retrieve sections must be in the same order.
12
+ *       If a feature is disabled, some data must still be written that, when read,
13
+ *       either sets a Sane Default, or results in No Change to the existing value.
14
+ *
15
+ */
16
+
17
+#define EEPROM_VERSION "V19"
18
+
19
+/**
20
+ * V19 EEPROM Layout:
7 21
  *
8 22
  *  ver
9 23
  *  axis_steps_per_unit (x4)
@@ -47,6 +61,9 @@
47 61
  *  Kp[2], Ki[2], Kd[2], Kc[2]
48 62
  *  Kp[3], Ki[3], Kd[3], Kc[3]
49 63
  *
64
+ * PIDTEMPBED:
65
+ *  bedKp, bedKi, bedKd
66
+ *
50 67
  * DOGLCD:
51 68
  *  lcd_contrast
52 69
  *
@@ -78,7 +95,7 @@
78 95
 #include "ultralcd.h"
79 96
 #include "ConfigurationStore.h"
80 97
 
81
-#if defined(MESH_BED_LEVELING)
98
+#ifdef MESH_BED_LEVELING
82 99
    #include "mesh_bed_leveling.h"
83 100
 #endif  // MESH_BED_LEVELING
84 101
 
@@ -111,15 +128,6 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
111 128
 
112 129
 #define EEPROM_OFFSET 100
113 130
 
114
-
115
-// IMPORTANT:  Whenever there are changes made to the variables stored in EEPROM
116
-// in the functions below, also increment the version number. This makes sure that
117
-// the default values are used whenever there is a change to the data, to prevent
118
-// wrong data being written to the variables.
119
-// ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
120
-
121
-#define EEPROM_VERSION "V18"
122
-
123 131
 #ifdef EEPROM_SETTINGS
124 132
 
125 133
 void Config_StoreSettings()  {
@@ -194,7 +202,6 @@ void Config_StoreSettings()  {
194 202
   EEPROM_WRITE_VAR(i, absPreheatHPBTemp);
195 203
   EEPROM_WRITE_VAR(i, absPreheatFanSpeed);
196 204
 
197
-
198 205
   for (int e = 0; e < 4; e++) {
199 206
 
200 207
     #ifdef PIDTEMP
@@ -209,12 +216,10 @@ void Config_StoreSettings()  {
209 216
           EEPROM_WRITE_VAR(i, dummy);
210 217
         #endif
211 218
       }
212
-      else {
213
-    #else // !PIDTEMP
214
-      {
219
+      else
215 220
     #endif // !PIDTEMP
216
-
217
-        dummy = DUMMY_PID_VALUE;
221
+      {
222
+        dummy = DUMMY_PID_VALUE; // When read, will not change the existing value
218 223
         EEPROM_WRITE_VAR(i, dummy);
219 224
         dummy = 0.0f;
220 225
         for (int q = 3; q--;) EEPROM_WRITE_VAR(i, dummy);
@@ -222,6 +227,14 @@ void Config_StoreSettings()  {
222 227
 
223 228
   } // Extruders Loop
224 229
 
230
+  #ifndef PIDTEMPBED
231
+    float bedKp = DUMMY_PID_VALUE, bedKi = DUMMY_PID_VALUE, bedKd = DUMMY_PID_VALUE;
232
+  #endif
233
+
234
+  EEPROM_WRITE_VAR(i, bedKp);
235
+  EEPROM_WRITE_VAR(i, bedKi);
236
+  EEPROM_WRITE_VAR(i, bedKd);
237
+
225 238
   #ifndef DOGLCD
226 239
     int lcd_contrast = 32;
227 240
   #endif
@@ -308,7 +321,7 @@ void Config_RetrieveSettings() {
308 321
 
309 322
     uint8_t mesh_num_x = 0;
310 323
     uint8_t mesh_num_y = 0;
311
-    #if defined(MESH_BED_LEVELING)
324
+    #ifdef MESH_BED_LEVELING
312 325
       EEPROM_READ_VAR(i, mbl.active);
313 326
       EEPROM_READ_VAR(i, mesh_num_x);
314 327
       EEPROM_READ_VAR(i, mesh_num_y);
@@ -364,7 +377,7 @@ void Config_RetrieveSettings() {
364 377
 
365 378
     #ifdef PIDTEMP
366 379
       for (int e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
367
-        EEPROM_READ_VAR(i, dummy);
380
+        EEPROM_READ_VAR(i, dummy); // Kp
368 381
         if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) {
369 382
           // do not need to scale PID values as the values in EEPROM are already scaled
370 383
           PID_PARAM(Kp, e) = dummy;
@@ -385,6 +398,20 @@ void Config_RetrieveSettings() {
385 398
       for (int q=16; q--;) EEPROM_READ_VAR(i, dummy);  // 4x Kp, Ki, Kd, Kc
386 399
     #endif // !PIDTEMP
387 400
 
401
+    #ifndef PIDTEMPBED
402
+      float bedKp, bedKi, bedKd;
403
+    #endif
404
+
405
+    EEPROM_READ_VAR(i, dummy); // bedKp
406
+    if (dummy != DUMMY_PID_VALUE) {
407
+      bedKp = dummy;
408
+      EEPROM_READ_VAR(i, bedKi);
409
+      EEPROM_READ_VAR(i, bedKd);
410
+    }
411
+    else {
412
+      for (int q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd
413
+    }
414
+
388 415
     #ifndef DOGLCD
389 416
       int lcd_contrast;
390 417
     #endif
@@ -517,6 +544,12 @@ void Config_ResetDefault() {
517 544
     updatePID();
518 545
   #endif // PIDTEMP
519 546
 
547
+  #ifdef PIDTEMPBED
548
+    bedKp = DEFAULT_bedKp;
549
+    bedKi = scalePID_i(DEFAULT_bedKi);
550
+    bedKd = scalePID_d(DEFAULT_bedKd);
551
+  #endif
552
+
520 553
   #ifdef FWRETRACT
521 554
     autoretract_enabled = false;
522 555
     retract_length = RETRACT_LENGTH;
@@ -660,17 +693,28 @@ void Config_PrintSettings(bool forReplay) {
660 693
     SERIAL_EOL;  
661 694
   #endif // DELTA
662 695
 
663
-  #ifdef PIDTEMP
696
+  #if defined(PIDTEMP) || defined(PIDTEMPBED)
664 697
     SERIAL_ECHO_START;
665 698
     if (!forReplay) {
666 699
       SERIAL_ECHOLNPGM("PID settings:");
667 700
       SERIAL_ECHO_START;
668 701
     }
669
-    SERIAL_ECHOPAIR("   M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echos values for E0
670
-    SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
671
-    SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
672
-    SERIAL_EOL;
673
-  #endif // PIDTEMP
702
+    #if defined(PIDTEMP) && defined(PIDTEMPBED)
703
+      SERIAL_EOL;
704
+    #endif
705
+    #ifdef PIDTEMP
706
+      SERIAL_ECHOPAIR("  M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echos values for E0
707
+      SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
708
+      SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
709
+      SERIAL_EOL;
710
+    #endif
711
+    #ifdef PIDTEMPBED
712
+      SERIAL_ECHOPAIR("  M304 P", bedKp); // for compatibility with hosts, only echos values for E0
713
+      SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi));
714
+      SERIAL_ECHOPAIR(" D", unscalePID_d(bedKd));
715
+      SERIAL_EOL;
716
+    #endif
717
+  #endif
674 718
 
675 719
   #ifdef FWRETRACT
676 720
 
@@ -679,7 +723,7 @@ void Config_PrintSettings(bool forReplay) {
679 723
       SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
680 724
       SERIAL_ECHO_START;
681 725
     }
682
-    SERIAL_ECHOPAIR("   M207 S", retract_length);
726
+    SERIAL_ECHOPAIR("  M207 S", retract_length);
683 727
     SERIAL_ECHOPAIR(" F", retract_feedrate*60);
684 728
     SERIAL_ECHOPAIR(" Z", retract_zlift);
685 729
     SERIAL_EOL;
@@ -688,7 +732,7 @@ void Config_PrintSettings(bool forReplay) {
688 732
       SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)");
689 733
       SERIAL_ECHO_START;
690 734
     }
691
-    SERIAL_ECHOPAIR("   M208 S", retract_recover_length);
735
+    SERIAL_ECHOPAIR("  M208 S", retract_recover_length);
692 736
     SERIAL_ECHOPAIR(" F", retract_recover_feedrate*60);
693 737
     SERIAL_EOL;
694 738
     SERIAL_ECHO_START;
@@ -696,7 +740,7 @@ void Config_PrintSettings(bool forReplay) {
696 740
       SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
697 741
       SERIAL_ECHO_START;
698 742
     }
699
-    SERIAL_ECHOPAIR("   M209 S", (unsigned long)(autoretract_enabled ? 1 : 0));
743
+    SERIAL_ECHOPAIR("  M209 S", (unsigned long)(autoretract_enabled ? 1 : 0));
700 744
     SERIAL_EOL;
701 745
 
702 746
     #if EXTRUDERS > 1
@@ -720,20 +764,20 @@ void Config_PrintSettings(bool forReplay) {
720 764
       SERIAL_ECHOLNPGM("Filament settings:");
721 765
       SERIAL_ECHO_START;
722 766
     }
723
-    SERIAL_ECHOPAIR("   M200 D", filament_size[0]);
767
+    SERIAL_ECHOPAIR("  M200 D", filament_size[0]);
724 768
     SERIAL_EOL;
725 769
 
726 770
     #if EXTRUDERS > 1
727 771
       SERIAL_ECHO_START;
728
-      SERIAL_ECHOPAIR("   M200 T1 D", filament_size[1]);
772
+      SERIAL_ECHOPAIR("  M200 T1 D", filament_size[1]);
729 773
       SERIAL_EOL;
730 774
       #if EXTRUDERS > 2
731 775
         SERIAL_ECHO_START;
732
-        SERIAL_ECHOPAIR("   M200 T2 D", filament_size[2]);
776
+        SERIAL_ECHOPAIR("  M200 T2 D", filament_size[2]);
733 777
         SERIAL_EOL;
734 778
         #if EXTRUDERS > 3
735 779
           SERIAL_ECHO_START;
736
-          SERIAL_ECHOPAIR("   M200 T3 D", filament_size[3]);
780
+          SERIAL_ECHOPAIR("  M200 T3 D", filament_size[3]);
737 781
           SERIAL_EOL;
738 782
         #endif
739 783
       #endif
@@ -752,7 +796,7 @@ void Config_PrintSettings(bool forReplay) {
752 796
         SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
753 797
         SERIAL_ECHO_START;
754 798
       }
755
-      SERIAL_ECHOPAIR("   M", (unsigned long)CUSTOM_M_CODE_SET_Z_PROBE_OFFSET);
799
+      SERIAL_ECHOPAIR("  M", (unsigned long)CUSTOM_M_CODE_SET_Z_PROBE_OFFSET);
756 800
       SERIAL_ECHOPAIR(" Z", -zprobe_zoffset);
757 801
     #else
758 802
       if (!forReplay) {

+ 3
- 3
Marlin/Configuration_adv.h View File

@@ -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
 

+ 54
- 37
Marlin/Marlin.h View File

@@ -62,59 +62,57 @@
62 62
   #define MYSERIAL MSerial
63 63
 #endif
64 64
 
65
-#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))
66
-#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y))
67
-#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x)))
68
-#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n'))
69
-#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n'))
65
+#define SERIAL_CHAR(x) MYSERIAL.write(x)
66
+#define SERIAL_EOL SERIAL_CHAR('\n')
67
+
68
+#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x)
69
+#define SERIAL_PROTOCOL(x) MYSERIAL.print(x)
70
+#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y)
71
+#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x))
72
+#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x),MYSERIAL.write('\n'); }while(0)
73
+#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)),MYSERIAL.write('\n'); }while(0)
70 74
 
71 75
 
72 76
 extern const char errormagic[] PROGMEM;
73 77
 extern const char echomagic[] PROGMEM;
74 78
 
75
-#define SERIAL_ERROR_START (serialprintPGM(errormagic))
79
+#define SERIAL_ERROR_START serialprintPGM(errormagic)
76 80
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
77 81
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
78 82
 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
79 83
 #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
80 84
 
81
-#define SERIAL_ECHO_START (serialprintPGM(echomagic))
85
+#define SERIAL_ECHO_START serialprintPGM(echomagic)
82 86
 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
83 87
 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
84 88
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
85 89
 #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
86 90
 
87
-#define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value)))
88
-
89
-#define SERIAL_EOL MYSERIAL.write('\n')
91
+#define SERIAL_ECHOPAIR(name,value) do{ serial_echopair_P(PSTR(name),(value)); }while(0)
90 92
 
91 93
 void serial_echopair_P(const char *s_P, float v);
92 94
 void serial_echopair_P(const char *s_P, double v);
93 95
 void serial_echopair_P(const char *s_P, unsigned long v);
94 96
 
95 97
 
96
-//Things to write to serial from Program memory. Saves 400 to 2k of RAM.
97
-FORCE_INLINE void serialprintPGM(const char *str)
98
-{
99
-  char ch=pgm_read_byte(str);
100
-  while(ch)
101
-  {
98
+// Things to write to serial from Program memory. Saves 400 to 2k of RAM.
99
+FORCE_INLINE void serialprintPGM(const char *str) {
100
+  char ch;
101
+  while ((ch = pgm_read_byte(str))) {
102 102
     MYSERIAL.write(ch);
103
-    ch=pgm_read_byte(++str);
103
+    str++;
104 104
   }
105 105
 }
106 106
 
107
-
108 107
 void get_command();
109 108
 void process_commands();
110 109
 
111 110
 void manage_inactivity(bool ignore_stepper_queue=false);
112 111
 
113
-#if defined(DUAL_X_CARRIAGE) && defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 \
114
-    && defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
112
+#if defined(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
115 113
   #define  enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
116 114
   #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
115
+#elif HAS_X_ENABLE
118 116
   #define  enable_x() X_ENABLE_WRITE( X_ENABLE_ON)
119 117
   #define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
120 118
 #else
@@ -122,7 +120,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
122 120
   #define disable_x() ;
123 121
 #endif
124 122
 
125
-#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
123
+#if HAS_Y_ENABLE
126 124
   #ifdef Y_DUAL_STEPPER_DRIVERS
127 125
     #define  enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
128 126
     #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
@@ -135,7 +133,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
135 133
   #define disable_y() ;
136 134
 #endif
137 135
 
138
-#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1
136
+#if HAS_Z_ENABLE
139 137
   #ifdef Z_DUAL_STEPPER_DRIVERS
140 138
     #define  enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
141 139
     #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
@@ -148,40 +146,53 @@ void manage_inactivity(bool ignore_stepper_queue=false);
148 146
   #define disable_z() ;
149 147
 #endif
150 148
 
151
-#if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1)
152
-  #define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON)
149
+#if HAS_E0_ENABLE
150
+  #define enable_e0()  E0_ENABLE_WRITE( E_ENABLE_ON)
153 151
   #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
154 152
 #else
155 153
   #define enable_e0()  /* nothing */
156 154
   #define disable_e0() /* nothing */
157 155
 #endif
158 156
 
159
-#if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1)
160
-  #define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON)
157
+#if (EXTRUDERS > 1) && HAS_E1_ENABLE
158
+  #define enable_e1()  E1_ENABLE_WRITE( E_ENABLE_ON)
161 159
   #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
162 160
 #else
163 161
   #define enable_e1()  /* nothing */
164 162
   #define disable_e1() /* nothing */
165 163
 #endif
166 164
 
167
-#if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1)
168
-  #define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON)
165
+#if (EXTRUDERS > 2) && HAS_E2_ENABLE
166
+  #define enable_e2()  E2_ENABLE_WRITE( E_ENABLE_ON)
169 167
   #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
170 168
 #else
171 169
   #define enable_e2()  /* nothing */
172 170
   #define disable_e2() /* nothing */
173 171
 #endif
174 172
 
175
-#if (EXTRUDERS > 3) && defined(E3_ENABLE_PIN) && (E3_ENABLE_PIN > -1)
176
-  #define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON)
173
+#if (EXTRUDERS > 3) && HAS_E3_ENABLE
174
+  #define enable_e3()  E3_ENABLE_WRITE( E_ENABLE_ON)
177 175
   #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
178 176
 #else
179 177
   #define enable_e3()  /* nothing */
180 178
   #define disable_e3() /* nothing */
181 179
 #endif
182 180
 
181
+/**
182
+ * The axis order in all axis related arrays is X, Y, Z, E
183
+ */
184
+#define NUM_AXIS 4
185
+
186
+/**
187
+ * Axis indices as enumerated constants
188
+ *
189
+ * A_AXIS and B_AXIS are used by COREXY printers
190
+ * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
191
+ */
183 192
 enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
184
-//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
193
+
194
+void enable_all_steppers();
195
+void disable_all_steppers();
185 196
 
186 197
 void FlushSerialRequestResend();
187 198
 void ClearToSend();
@@ -194,7 +205,6 @@ void get_coordinates();
194 205
     void adjust_delta(float cartesian[3]);
195 206
   #endif
196 207
   extern float delta[3];
197
-  void prepare_move_raw();
198 208
 #endif
199 209
 #ifdef SCARA
200 210
   void calculate_delta(float cartesian[3]);
@@ -217,7 +227,8 @@ void enquecommands_P(const char *cmd); //put one or many ASCII commands at the e
217 227
 void prepare_arc_move(char isclockwise);
218 228
 void clamp_to_software_endstops(float target[3]);
219 229
 
220
-void refresh_cmd_timeout(void);
230
+extern unsigned long previous_millis_cmd;
231
+inline void refresh_cmd_timeout() { previous_millis_cmd = millis(); }
221 232
 
222 233
 #ifdef FAST_PWM_FAN
223 234
   void setPwmFrequency(uint8_t pin, int val);
@@ -226,7 +237,7 @@ void refresh_cmd_timeout(void);
226 237
 #ifndef CRITICAL_SECTION_START
227 238
   #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
228 239
   #define CRITICAL_SECTION_END    SREG = _sreg;
229
-#endif //CRITICAL_SECTION_START
240
+#endif
230 241
 
231 242
 extern float homing_feedrate[];
232 243
 extern bool axis_relative_modes[];
@@ -235,8 +246,9 @@ extern bool volumetric_enabled;
235 246
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
236 247
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
237 248
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
238
-extern float current_position[NUM_AXIS] ;
249
+extern float current_position[NUM_AXIS];
239 250
 extern float home_offset[3];
251
+
240 252
 #ifdef DELTA
241 253
   extern float endstop_adj[3];
242 254
   extern float delta_radius;
@@ -244,18 +256,23 @@ extern float home_offset[3];
244 256
   extern float delta_segments_per_second;
245 257
   void recalc_delta_settings(float radius, float diagonal_rod);
246 258
 #elif defined(Z_DUAL_ENDSTOPS)
247
-extern float z_endstop_adj;
259
+  extern float z_endstop_adj;
248 260
 #endif
261
+
249 262
 #ifdef SCARA
250 263
   extern float axis_scaling[3];  // Build size scaling
251 264
 #endif
265
+
252 266
 extern float min_pos[3];
253 267
 extern float max_pos[3];
254 268
 extern bool axis_known_position[3];
269
+
255 270
 #ifdef ENABLE_AUTO_BED_LEVELING
256 271
   extern float zprobe_zoffset;
257 272
 #endif
273
+
258 274
 extern int fanSpeed;
275
+
259 276
 #ifdef BARICUDA
260 277
   extern int ValvePressure;
261 278
   extern int EtoPPressure;

+ 3
- 5
Marlin/MarlinSerial.cpp View File

@@ -268,8 +268,7 @@ void MarlinSerial::printFloat(double number, uint8_t digits) {
268 268
   print(int_part);
269 269
 
270 270
   // Print the decimal point, but only if there are digits beyond
271
-  if (digits > 0)
272
-    print("."); 
271
+  if (digits > 0) print('.');
273 272
 
274 273
   // Extract digits from the remainder one at a time
275 274
   while (digits-- > 0) {
@@ -288,7 +287,6 @@ MarlinSerial MSerial;
288 287
 #endif // !AT90USB
289 288
 
290 289
 // For AT90USB targets use the UART for BT interfacing
291
-#if defined(AT90USB) && defined (BTENABLED)
292
-   HardwareSerial bt;
290
+#if defined(AT90USB) && defined(BTENABLED)
291
+  HardwareSerial bt;
293 292
 #endif
294
-

+ 2
- 2
Marlin/MarlinSerial.h View File

@@ -153,8 +153,8 @@ extern MarlinSerial MSerial;
153 153
 #endif // !AT90USB
154 154
 
155 155
 // Use the UART for BT in AT90USB configurations
156
-#if defined(AT90USB) && defined (BTENABLED)
157
-   extern HardwareSerial bt;
156
+#if defined(AT90USB) && defined(BTENABLED)
157
+  extern HardwareSerial bt;
158 158
 #endif
159 159
 
160 160
 #endif

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


+ 51
- 7
Marlin/SanityCheck.h View File

@@ -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)
@@ -93,14 +100,40 @@
93 100
      * Require a Z Min pin
94 101
      */
95 102
     #if Z_MIN_PIN == -1
96
-      #ifdef Z_PROBE_REPEATABILITY_TEST
97
-        #error You must have a Z_MIN endstop to enable Z_PROBE_REPEATABILITY_TEST.
98
-      #else
99
-        #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN endstop. Z_MIN_PIN must point to a valid hardware pin.
103
+      #if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
104
+        #ifdef Z_PROBE_REPEATABILITY_TEST
105
+          #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
106
+        #else
107
+          #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin.
108
+        #endif
100 109
       #endif
101 110
     #endif
102 111
 
103 112
     /**
113
+     * Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled.
114
+     */
115
+    #if defined(Z_PROBE_ENDSTOP)
116
+      #ifndef Z_PROBE_PIN
117
+        #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP
118
+      #endif
119
+      #if Z_PROBE_PIN == -1
120
+        #error You must set Z_PROBE_PIN to a valid pin if you enable Z_PROBE_ENDSTOP
121
+      #endif
122
+// Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
123
+//      #ifndef NUM_SERVOS
124
+//        #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_ENDSTOP
125
+//      #endif
126
+//      #if defined(NUM_SERVOS) && NUM_SERVOS < 1
127
+//        #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_ENDSTOP
128
+//      #endif
129
+//      #ifndef SERVO_ENDSTOPS
130
+//        #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_ENDSTOP
131
+//      #endif
132
+//      #ifndef SERVO_ENDSTOP_ANGLES
133
+//        #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP
134
+//      #endif
135
+    #endif
136
+    /**
104 137
      * Check if Probe_Offset * Grid Points is greater than Probing Range
105 138
      */
106 139
     #ifdef AUTO_BED_LEVELING_GRID
@@ -209,9 +242,9 @@
209 242
    */
210 243
   #ifdef DUAL_X_CARRIAGE
211 244
     #if EXTRUDERS == 1 || defined(COREXY) \
212
-        || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
245
+        || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
213 246
         || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
214
-        || !defined(X_MAX_PIN) || X_MAX_PIN < 0
247
+        || !HAS_X_MAX
215 248
       #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
216 249
     #endif
217 250
     #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
@@ -234,6 +267,10 @@
234 267
     #endif
235 268
   #endif
236 269
 
270
+  #if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN
271
+    #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN
272
+  #endif
273
+
237 274
   /**
238 275
    * Test required HEATER defines
239 276
    */
@@ -254,4 +291,11 @@
254 291
     #error HEATER_0_PIN not defined for this board
255 292
   #endif
256 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
+
257 301
 #endif //SANITYCHECK_H

+ 1
- 1
Marlin/Servo.h View File

@@ -123,7 +123,7 @@ class Servo {
123 123
     int read();                        // returns current pulse width as an angle between 0 and 180 degrees
124 124
     int readMicroseconds();            // returns current pulse width in microseconds for this servo (was read_us() in first release)
125 125
     bool attached();                   // return true if this servo is attached, otherwise false
126
-    #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
126
+    #if defined(ENABLE_AUTO_BED_LEVELING) && PROBE_SERVO_DEACTIVATION_DELAY > 0
127 127
       int pin;                           // store the hardware pin of the servo
128 128
     #endif
129 129
   private:

+ 1
- 0
Marlin/boards.h View File

@@ -37,6 +37,7 @@
37 37
 #define BOARD_BRAINWAVE         82   // Brainwave (AT90USB646)
38 38
 #define BOARD_SAV_MKI           83   // SAV Mk-I (AT90USB1286)
39 39
 #define BOARD_TEENSY2           84   // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84  make
40
+#define BOARD_BRAINWAVE_PRO     85   // Brainwave Pro (AT90USB1286)
40 41
 #define BOARD_GEN3_PLUS         9    // Gen3+
41 42
 #define BOARD_GEN3_MONOLITHIC   22   // Gen3 Monolithic Electronics
42 43
 #define BOARD_MEGATRONICS       70   // Megatronics

+ 6
- 6
Marlin/cardreader.cpp View File

@@ -249,7 +249,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/)
249 249
         if (!myDir.open(curDir, subdirname, O_READ)) {
250 250
           SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
251 251
           SERIAL_PROTOCOL(subdirname);
252
-          SERIAL_PROTOCOLLNPGM(".");
252
+          SERIAL_PROTOCOLCHAR('.');
253 253
           return;
254 254
         }
255 255
         else {
@@ -287,14 +287,14 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/)
287 287
     else {
288 288
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
289 289
       SERIAL_PROTOCOL(fname);
290
-      SERIAL_PROTOCOLLNPGM(".");
290
+      SERIAL_PROTOCOLCHAR('.');
291 291
     }
292 292
   }
293 293
   else { //write
294 294
     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
295 295
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
296 296
       SERIAL_PROTOCOL(fname);
297
-      SERIAL_PROTOCOLLNPGM(".");
297
+      SERIAL_PROTOCOLCHAR('.');
298 298
     }
299 299
     else {
300 300
       saving = true;
@@ -330,7 +330,7 @@ void CardReader::removeFile(char* name) {
330 330
         if (!myDir.open(curDir, subdirname, O_READ)) {
331 331
           SERIAL_PROTOCOLPGM("open failed, File: ");
332 332
           SERIAL_PROTOCOL(subdirname);
333
-          SERIAL_PROTOCOLLNPGM(".");
333
+          SERIAL_PROTOCOLCHAR('.');
334 334
           return;
335 335
         }
336 336
         else {
@@ -360,7 +360,7 @@ void CardReader::removeFile(char* name) {
360 360
   else {
361 361
     SERIAL_PROTOCOLPGM("Deletion failed, File: ");
362 362
     SERIAL_PROTOCOL(fname);
363
-    SERIAL_PROTOCOLLNPGM(".");
363
+    SERIAL_PROTOCOLCHAR('.');
364 364
   }
365 365
 }
366 366
 
@@ -368,7 +368,7 @@ void CardReader::getStatus() {
368 368
   if (cardOK) {
369 369
     SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE);
370 370
     SERIAL_PROTOCOL(sdpos);
371
-    SERIAL_PROTOCOLPGM("/");
371
+    SERIAL_PROTOCOLCHAR('/');
372 372
     SERIAL_PROTOCOLLN(filesize);
373 373
   }
374 374
   else {

+ 19
- 3
Marlin/configurator/config/Configuration.h View File

@@ -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 separate 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
 
@@ -539,8 +553,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
539 553
 
540 554
 // @section movement
541 555
 
542
-//// MOVEMENT SETTINGS
543
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
556
+/**
557
+ * MOVEMENT SETTINGS
558
+ */
559
+
544 560
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
545 561
 
546 562
 // default settings

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

@@ -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 View File

@@ -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
 

+ 19
- 3
Marlin/example_configurations/Felix/Configuration.h View File

@@ -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 separate 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
 
@@ -485,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
485 499
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
486 500
 #endif
487 501
 
488
-//// MOVEMENT SETTINGS
489
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
502
+/**
503
+ * MOVEMENT SETTINGS
504
+ */
505
+
490 506
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
491 507
 
492 508
 // default settings

+ 19
- 3
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -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 separate 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
 
@@ -485,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
485 499
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
486 500
 #endif
487 501
 
488
-//// MOVEMENT SETTINGS
489
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
502
+/**
503
+ * MOVEMENT SETTINGS
504
+ */
505
+
490 506
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
491 507
 
492 508
 // default settings

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

@@ -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
 

+ 19
- 3
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -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 separate 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
 
@@ -508,8 +522,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
508 522
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
509 523
 #endif
510 524
 
511
-//// MOVEMENT SETTINGS
512
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
525
+/**
526
+ * MOVEMENT SETTINGS
527
+ */
528
+
513 529
 #define HOMING_FEEDRATE {2000, 2000, 150, 0}  // set the homing speeds (mm/min)
514 530
 
515 531
 // default settings

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

@@ -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
- 3
Marlin/example_configurations/K8200/Configuration.h View File

@@ -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 separate 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
 
@@ -513,8 +527,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
513 527
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
514 528
 #endif
515 529
 
516
-//// MOVEMENT SETTINGS
517
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
530
+/**
531
+ * MOVEMENT SETTINGS
532
+ */
533
+
518 534
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
519 535
 
520 536
 // default settings

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

@@ -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
 

+ 19
- 3
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -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 separate 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
 
@@ -537,8 +551,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
537 551
   #define MANUAL_Z_HOME_POS 0.1  // Distance between nozzle and print surface after homing.
538 552
 #endif
539 553
 
540
-//// MOVEMENT SETTINGS
541
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
554
+/**
555
+ * MOVEMENT SETTINGS
556
+ */
557
+
542 558
 #define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0}  // set the homing speeds (mm/min)
543 559
 
544 560
 // default settings

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

@@ -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
 

+ 19
- 3
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -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 separate 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
 
@@ -507,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
507 521
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
508 522
 #endif
509 523
 
510
-//// MOVEMENT SETTINGS
511
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
524
+/**
525
+ * MOVEMENT SETTINGS
526
+ */
527
+
512 528
 #define HOMING_FEEDRATE {120*60, 120*60, 7.2*60, 0}  // set the homing speeds (mm/min)
513 529
 
514 530
 // default settings

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

@@ -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
 

+ 23
- 7
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -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 separate 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
 
@@ -552,8 +566,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
552 566
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
553 567
 #endif
554 568
 
555
-//// MOVEMENT SETTINGS
556
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
569
+/**
570
+ * MOVEMENT SETTINGS
571
+ */
572
+
557 573
 
558 574
 // delta homing speeds must be the same on xyz
559 575
 #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0}  // set the homing speeds (mm/min)

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

@@ -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
 

+ 23
- 7
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -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 separate 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
 
@@ -556,8 +570,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
556 570
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
557 571
 #endif
558 572
 
559
-//// MOVEMENT SETTINGS
560
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
573
+/**
574
+ * MOVEMENT SETTINGS
575
+ */
576
+
561 577
 
562 578
 // delta homing speeds must be the same on xyz
563 579
 #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0}  // set the homing speeds (mm/min)

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

@@ -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
- 3
Marlin/example_configurations/makibox/Configuration.h View File

@@ -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 separate 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
 
@@ -505,8 +519,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
505 519
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
506 520
 #endif
507 521
 
508
-//// MOVEMENT SETTINGS
509
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
522
+/**
523
+ * MOVEMENT SETTINGS
524
+ */
525
+
510 526
 #define HOMING_FEEDRATE {1500, 1500, 120, 0}  // set the homing speeds (mm/min)   ***** MakiBox A6 *****
511 527
 
512 528
 // default settings

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

@@ -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
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -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 separate 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
 
@@ -507,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
507 521
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
508 522
 #endif
509 523
 
510
-//// MOVEMENT SETTINGS
511
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
524
+/**
525
+ * MOVEMENT SETTINGS
526
+ */
527
+
512 528
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
513 529
 
514 530
 // default settings

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

@@ -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
 

+ 5
- 5
Marlin/fastio.h View File

@@ -91,7 +91,7 @@
91 91
 	added as necessary or if I feel like it- not a comprehensive list!
92 92
 */
93 93
 
94
-#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
94
+#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
95 95
 // UART
96 96
 #define	RXD					DIO0
97 97
 #define	TXD					DIO1
@@ -426,7 +426,7 @@ pins
426 426
 #define PD7_PWM			NULL
427 427
 #endif	/*	_AVR_ATmega{168,328,328P}__ */
428 428
 
429
-#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) || defined (__AVR_ATmega1284P__)
429
+#if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
430 430
 // UART
431 431
 #define	RXD					DIO8
432 432
 #define	TXD					DIO9
@@ -929,7 +929,7 @@ pins
929 929
 #define PD7_PWM			OCR2A
930 930
 #endif	/*	_AVR_ATmega{644,644P,644PA}__ */
931 931
 
932
-#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)
932
+#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
933 933
 // UART
934 934
 #define	RXD					DIO0
935 935
 #define	TXD					DIO1
@@ -2024,7 +2024,7 @@ pins
2024 2024
 
2025 2025
 #endif
2026 2026
 
2027
-#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) || defined (__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
2027
+#if defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
2028 2028
 // SPI
2029 2029
 #define	SCK					DIO9
2030 2030
 #define	MISO				DIO11
@@ -3322,7 +3322,7 @@ Teensy   28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17
3322 3322
 #endif // __AVR_AT90usbxxx__
3323 3323
 
3324 3324
 
3325
-#if defined (__AVR_ATmega1281__) || defined (__AVR_ATmega2561__)
3325
+#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
3326 3326
 // UART
3327 3327
 #define	RXD					DIO0
3328 3328
 #define	TXD					DIO1

+ 29
- 10
Marlin/language.h View File

@@ -36,18 +36,19 @@
36 36
   #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en)
37 37
 #endif
38 38
 
39
+#ifdef HAS_AUTOMATIC_VERSIONING
40
+  #include "_Version.h"
41
+#endif
42
+
39 43
 #define PROTOCOL_VERSION "1.0"
40
-#define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin"
41 44
 
42 45
 #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2)
43
-  #undef FIRMWARE_URL
44 46
   #define MACHINE_NAME "Ultimaker"
45 47
   #define FIRMWARE_URL "http://firmware.ultimaker.com"
46 48
 #elif MB(RUMBA)
47 49
   #define MACHINE_NAME "Rumba"
48 50
 #elif MB(3DRAG)
49 51
   #define MACHINE_NAME "3Drag"
50
-  #undef FIRMWARE_URL
51 52
   #define FIRMWARE_URL "http://3dprint.elettronicain.it/"
52 53
 #elif MB(K8200)
53 54
   #define MACHINE_NAME "K8200"
@@ -55,23 +56,40 @@
55 56
   #define MACHINE_NAME "Makibox"
56 57
 #elif MB(SAV_MKI)
57 58
   #define MACHINE_NAME "SAV MkI"
58
-  #undef FIRMWARE_URL
59 59
   #define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
60 60
 #elif MB(WITBOX)
61 61
   #define MACHINE_NAME "WITBOX"
62
-  #undef FIRMWARE_URL
63 62
   #define FIRMWARE_URL "http://www.bq.com/gb/downloads-witbox.html"
64 63
 #elif MB(HEPHESTOS)
65 64
   #define MACHINE_NAME "HEPHESTOS"
66
-  #undef FIRMWARE_URL
67 65
   #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html"
68
-#else // Default firmware set to Mendel
69
-  #define MACHINE_NAME "Mendel"
66
+#elif MB(BRAINWAVE_PRO)
67
+  #define MACHINE_NAME "Kossel Pro"
68
+  #ifndef FIRMWARE_URL
69
+    #define FIRMWARE_URL "https://github.com/OpenBeamUSA/Marlin/"
70
+  #endif
71
+#else
72
+  #ifndef MACHINE_NAME
73
+    #define MACHINE_NAME "Mendel"
74
+  #endif
70 75
 #endif
71 76
 
72 77
 #ifdef CUSTOM_MENDEL_NAME
78
+  #warning CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME
79
+  #define CUSTOM_MACHINE_NAME CUSTOM_MENDEL_NAME
80
+#endif
81
+
82
+#ifdef CUSTOM_MACHINE_NAME
73 83
   #undef MACHINE_NAME
74
-  #define MACHINE_NAME CUSTOM_MENDEL_NAME
84
+  #define MACHINE_NAME CUSTOM_MACHINE_NAME
85
+#endif
86
+
87
+#ifndef FIRMWARE_URL
88
+  #define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin"
89
+#endif
90
+
91
+#ifndef BUILD_VERSION
92
+  #define BUILD_VERSION "V1; Sprinter/grbl mashup for gen6"
75 93
 #endif
76 94
 
77 95
 #ifndef MACHINE_UUID
@@ -122,7 +140,7 @@
122 140
 #define MSG_HEATING_COMPLETE                "Heating done."
123 141
 #define MSG_BED_HEATING                     "Bed Heating."
124 142
 #define MSG_BED_DONE                        "Bed done."
125
-#define MSG_M115_REPORT                     "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
143
+#define MSG_M115_REPORT                     "FIRMWARE_NAME:Marlin " BUILD_VERSION " FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
126 144
 #define MSG_COUNT_X                         " Count X: "
127 145
 #define MSG_ERR_KILLED                      "Printer halted. kill() called!"
128 146
 #define MSG_ERR_STOPPED                     "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
@@ -138,6 +156,7 @@
138 156
 #define MSG_Z_MIN                           "z_min: "
139 157
 #define MSG_Z_MAX                           "z_max: "
140 158
 #define MSG_Z2_MAX                          "z2_max: "
159
+#define MSG_Z_PROBE                         "z_probe: "
141 160
 #define MSG_M119_REPORT                     "Reporting endstop status"
142 161
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
143 162
 #define MSG_ENDSTOP_OPEN                    "open"

+ 1
- 1
Marlin/mesh_bed_leveling.h View File

@@ -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))

+ 9
- 2
Marlin/pins.h View File

@@ -187,6 +187,10 @@
187 187
   #define Z_MIN_PIN          -1
188 188
 #endif
189 189
 
190
+#if defined(DISABLE_Z_PROBE_ENDSTOP) || !defined(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
191
+  #define Z_PROBE_PIN        -1
192
+#endif
193
+
190 194
 #ifdef DISABLE_XMAX_ENDSTOP
191 195
   #undef X_MAX_PIN
192 196
   #define X_MAX_PIN          -1
@@ -216,8 +220,11 @@
216 220
   #define Z_MIN_PIN          -1
217 221
 #endif
218 222
 
219
-#define SENSITIVE_PINS { 0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \
220
-                        HEATER_BED_PIN, FAN_PIN, \
223
+#define SENSITIVE_PINS { 0, 1, \
224
+                        X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
225
+                        Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \
226
+                        Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, \
227
+                        PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, \
221 228
                         _E0_PINS _E1_PINS _E2_PINS _E3_PINS \
222 229
                         analogInputToDigitalPin(TEMP_BED_PIN) \
223 230
                        }

+ 6
- 1
Marlin/pins_AZTEEG_X3_PRO.h View File

@@ -34,7 +34,12 @@
34 34
   #define Z_MAX_PIN          18
35 35
  #endif
36 36
 //
37
-
37
+ #ifdef Z_PROBE_ENDSTOP
38
+//#undef Z_MIN_PIN
39
+//#define Z_MIN_PIN        15
40
+  #define Z_PROBE_PIN      19
41
+ #endif
42
+//
38 43
 #define E2_STEP_PIN        23
39 44
 #define E2_DIR_PIN         25
40 45
 #define E2_ENABLE_PIN      40

+ 7
- 1
Marlin/pins_RAMPS_13.h View File

@@ -34,6 +34,7 @@
34 34
 #define Z_ENABLE_PIN       62
35 35
 #define Z_MIN_PIN          18
36 36
 #define Z_MAX_PIN          19
37
+#define Z_PROBE_PIN        -1
37 38
 
38 39
 #define Y2_STEP_PIN        36
39 40
 #define Y2_DIR_PIN         34
@@ -61,7 +62,12 @@
61 62
   #define FILWIDTH_PIN        5
62 63
 #endif
63 64
 
64
-#if defined(FILAMENT_RUNOUT_SENSOR)
65
+#ifdef Z_PROBE_ENDSTOP
66
+  // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
67
+  #define Z_PROBE_PIN 32
68
+#endif
69
+
70
+#ifdef FILAMENT_RUNOUT_SENSOR
65 71
   // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
66 72
   #define FILRUNOUT_PIN        4
67 73
 #endif

+ 9
- 9
Marlin/planner.cpp View File

@@ -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
 
@@ -67,7 +67,7 @@
67 67
 //===========================================================================
68 68
 
69 69
 unsigned long minsegmenttime;
70
-float max_feedrate[NUM_AXIS]; // set the max speeds
70
+float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
71 71
 float axis_steps_per_unit[NUM_AXIS];
72 72
 unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
73 73
 float minimumfeedrate;
@@ -427,7 +427,7 @@ void check_axes_activity() {
427 427
     disable_e3();
428 428
   }
429 429
 
430
-  #if defined(FAN_PIN) && FAN_PIN > -1 // HAS_FAN
430
+  #if HAS_FAN
431 431
     #ifdef FAN_KICKSTART_TIME
432 432
       static unsigned long fan_kick_end;
433 433
       if (tail_fan_speed) {
@@ -447,17 +447,17 @@ void check_axes_activity() {
447 447
     #else
448 448
       analogWrite(FAN_PIN, tail_fan_speed);
449 449
     #endif //!FAN_SOFT_PWM
450
-  #endif //FAN_PIN > -1
450
+  #endif // HAS_FAN
451 451
 
452 452
   #ifdef AUTOTEMP
453 453
     getHighESpeed();
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
@@ -614,7 +614,7 @@ float junction_deviation = 0.1;
614 614
         #if EXTRUDERS > 1
615 615
           case 1:
616 616
             enable_e1();
617
-            g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2;
617
+            g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2;
618 618
             if (g_uc_extruder_last_move[0] == 0) disable_e0();
619 619
             #if EXTRUDERS > 2
620 620
               if (g_uc_extruder_last_move[2] == 0) disable_e2();
@@ -626,7 +626,7 @@ float junction_deviation = 0.1;
626 626
           #if EXTRUDERS > 2
627 627
             case 2:
628 628
               enable_e2();
629
-              g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2;
629
+              g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2;
630 630
               if (g_uc_extruder_last_move[0] == 0) disable_e0();
631 631
               if (g_uc_extruder_last_move[1] == 0) disable_e1();
632 632
               #if EXTRUDERS > 3
@@ -636,7 +636,7 @@ float junction_deviation = 0.1;
636 636
             #if EXTRUDERS > 3
637 637
               case 3:
638 638
                 enable_e3();
639
-                g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE*2;
639
+                g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2;
640 640
                 if (g_uc_extruder_last_move[0] == 0) disable_e0();
641 641
                 if (g_uc_extruder_last_move[1] == 0) disable_e1();
642 642
                 if (g_uc_extruder_last_move[2] == 0) disable_e2();

+ 105
- 68
Marlin/stepper.cpp View File

@@ -76,6 +76,7 @@ volatile long endstops_stepsTotal, endstops_stepsDone;
76 76
 static volatile bool endstop_x_hit = false;
77 77
 static volatile bool endstop_y_hit = false;
78 78
 static volatile bool endstop_z_hit = false;
79
+static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_PROBE_ENDSTOP isn't defined, keeps code below cleaner. #ifdef it and usage below to save space.
79 80
 
80 81
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
81 82
   bool abort_on_endstop_hit = false;
@@ -85,33 +86,37 @@ static volatile bool endstop_z_hit = false;
85 86
   int motor_current_setting[3] = DEFAULT_PWM_MOTOR_CURRENT;
86 87
 #endif
87 88
 
88
-#if defined(X_MIN_PIN) && X_MIN_PIN >= 0
89
+#if HAS_X_MIN
89 90
   static bool old_x_min_endstop = false;
90 91
 #endif
91
-#if defined(X_MAX_PIN) && X_MAX_PIN >= 0
92
+#if HAS_X_MAX
92 93
   static bool old_x_max_endstop = false;
93 94
 #endif
94
-#if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
95
+#if HAS_Y_MIN
95 96
   static bool old_y_min_endstop = false;
96 97
 #endif
97
-#if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
98
+#if HAS_Y_MAX
98 99
   static bool old_y_max_endstop = false;
99 100
 #endif
100
-#if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
101
+#if HAS_Z_MIN
101 102
   static bool old_z_min_endstop = false;
102 103
 #endif
103
-#if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
104
+#if HAS_Z_MAX
104 105
   static bool old_z_max_endstop = false;
105 106
 #endif
106 107
 #ifdef Z_DUAL_ENDSTOPS
107
-  #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
108
+  #if HAS_Z2_MIN
108 109
     static bool old_z2_min_endstop = false;
109 110
   #endif
110
-  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
111
+  #if HAS_Z2_MAX
111 112
     static bool old_z2_max_endstop = false;
112 113
   #endif
113 114
 #endif
114 115
 
116
+#ifdef Z_PROBE_ENDSTOP // No need to check for valid pin, SanityCheck.h already does this.
117
+static bool old_z_probe_endstop = false;
118
+#endif
119
+
115 120
 static bool check_endstops = true;
116 121
 
117 122
 volatile long count_position[NUM_AXIS] = { 0 };
@@ -254,11 +259,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
254 259
 #define DISABLE_STEPPER_DRIVER_INTERRUPT() TIMSK1 &= ~BIT(OCIE1A)
255 260
 
256 261
 void endstops_hit_on_purpose() {
257
-  endstop_x_hit = endstop_y_hit = endstop_z_hit = false;
262
+  endstop_x_hit = endstop_y_hit = endstop_z_hit = endstop_z_probe_hit = false; // #ifdef endstop_z_probe_hit = to save space if needed.
258 263
 }
259 264
 
260 265
 void checkHitEndstops() {
261
-  if (endstop_x_hit || endstop_y_hit || endstop_z_hit) {
266
+  if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) { // #ifdef || endstop_z_probe_hit to save space if needed.
262 267
     SERIAL_ECHO_START;
263 268
     SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
264 269
     if (endstop_x_hit) {
@@ -273,6 +278,12 @@ void checkHitEndstops() {
273 278
       SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
274 279
       LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
275 280
     }
281
+    #ifdef Z_PROBE_ENDSTOP
282
+    if (endstop_z_probe_hit) {
283
+    	SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
284
+    	LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
285
+    }
286
+    #endif
276 287
     SERIAL_EOL;
277 288
 
278 289
     endstops_hit_on_purpose();
@@ -472,7 +483,7 @@ ISR(TIMER1_COMPA_vect) {
472 483
               if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
473 484
             #endif          
474 485
               {
475
-                #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
486
+                #if HAS_X_MIN
476 487
                   UPDATE_ENDSTOP(x, X, min, MIN);
477 488
                 #endif
478 489
               }
@@ -483,7 +494,7 @@ ISR(TIMER1_COMPA_vect) {
483 494
               if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
484 495
             #endif
485 496
               {
486
-                #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
497
+                #if HAS_X_MAX
487 498
                   UPDATE_ENDSTOP(x, X, max, MAX);
488 499
                 #endif
489 500
               }
@@ -498,12 +509,12 @@ ISR(TIMER1_COMPA_vect) {
498 509
           if (TEST(out_bits, Y_AXIS))   // -direction
499 510
       #endif
500 511
           { // -direction
501
-            #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
512
+            #if HAS_Y_MIN
502 513
               UPDATE_ENDSTOP(y, Y, min, MIN);
503 514
             #endif
504 515
           }
505 516
           else { // +direction
506
-            #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
517
+            #if HAS_Y_MAX
507 518
               UPDATE_ENDSTOP(y, Y, max, MAX);
508 519
             #endif
509 520
           }
@@ -519,13 +530,13 @@ ISR(TIMER1_COMPA_vect) {
519 530
 
520 531
       if (check_endstops) {
521 532
 
522
-        #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
533
+        #if HAS_Z_MIN
523 534
 
524 535
           #ifdef Z_DUAL_ENDSTOPS
525 536
 
526 537
             bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING,
527 538
                 z2_min_endstop =
528
-                  #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
539
+                  #if HAS_Z2_MIN
529 540
                     READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING
530 541
                   #else
531 542
                     z_min_endstop
@@ -551,6 +562,19 @@ ISR(TIMER1_COMPA_vect) {
551 562
 
552 563
         #endif // Z_MIN_PIN
553 564
 
565
+        #ifdef Z_PROBE_ENDSTOP
566
+          UPDATE_ENDSTOP(z, Z, probe, PROBE);
567
+          z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
568
+          if(z_probe_endstop && old_z_probe_endstop)
569
+          {
570
+        	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
571
+        	  endstop_z_probe_hit=true;
572
+
573
+//        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
574
+          }
575
+          old_z_probe_endstop = z_probe_endstop;
576
+        #endif
577
+        
554 578
       } // check_endstops
555 579
 
556 580
     }
@@ -561,13 +585,13 @@ ISR(TIMER1_COMPA_vect) {
561 585
 
562 586
       if (check_endstops) {
563 587
 
564
-        #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
588
+        #if HAS_Z_MAX
565 589
 
566 590
           #ifdef Z_DUAL_ENDSTOPS
567 591
 
568 592
             bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING,
569 593
                 z2_max_endstop =
570
-                  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
594
+                  #if HAS_Z2_MAX
571 595
                     READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING
572 596
                   #else
573 597
                     z_max_endstop
@@ -596,6 +620,18 @@ ISR(TIMER1_COMPA_vect) {
596 620
           #endif // !Z_DUAL_ENDSTOPS
597 621
 
598 622
         #endif // Z_MAX_PIN
623
+        
624
+        #ifdef Z_PROBE_ENDSTOP
625
+          UPDATE_ENDSTOP(z, Z, probe, PROBE);
626
+          z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
627
+          if(z_probe_endstop && old_z_probe_endstop)
628
+          {
629
+        	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
630
+        	  endstop_z_probe_hit=true;
631
+//        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
632
+          }
633
+          old_z_probe_endstop = z_probe_endstop;
634
+        #endif
599 635
 
600 636
       } // check_endstops
601 637
 
@@ -679,7 +715,7 @@ ISR(TIMER1_COMPA_vect) {
679 715
       step_events_completed++;
680 716
       if (step_events_completed >= current_block->step_event_count) break;
681 717
     }
682
-    // Calculare new timer value
718
+    // Calculate new timer value
683 719
     unsigned short timer;
684 720
     unsigned short step_rate;
685 721
     if (step_events_completed <= (unsigned long int)current_block->accelerate_until) {
@@ -835,133 +871,140 @@ void st_init() {
835 871
   #endif
836 872
   
837 873
   // Initialize Dir Pins
838
-  #if defined(X_DIR_PIN) && X_DIR_PIN >= 0
874
+  #if HAS_X_DIR
839 875
     X_DIR_INIT;
840 876
   #endif
841
-  #if defined(X2_DIR_PIN) && X2_DIR_PIN >= 0
877
+  #if HAS_X2_DIR
842 878
     X2_DIR_INIT;
843 879
   #endif
844
-  #if defined(Y_DIR_PIN) && Y_DIR_PIN >= 0
880
+  #if HAS_Y_DIR
845 881
     Y_DIR_INIT;
846
-    #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_DIR_PIN) && Y2_DIR_PIN >= 0
882
+    #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_DIR
847 883
       Y2_DIR_INIT;
848 884
     #endif
849 885
   #endif
850
-  #if defined(Z_DIR_PIN) && Z_DIR_PIN >= 0
886
+  #if HAS_Z_DIR
851 887
     Z_DIR_INIT;
852
-    #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_DIR_PIN) && Z2_DIR_PIN >= 0
888
+    #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_DIR
853 889
       Z2_DIR_INIT;
854 890
     #endif
855 891
   #endif
856
-  #if defined(E0_DIR_PIN) && E0_DIR_PIN >= 0
892
+  #if HAS_E0_DIR
857 893
     E0_DIR_INIT;
858 894
   #endif
859
-  #if defined(E1_DIR_PIN) && E1_DIR_PIN >= 0
895
+  #if HAS_E1_DIR
860 896
     E1_DIR_INIT;
861 897
   #endif
862
-  #if defined(E2_DIR_PIN) && E2_DIR_PIN >= 0
898
+  #if HAS_E2_DIR
863 899
     E2_DIR_INIT;
864 900
   #endif
865
-  #if defined(E3_DIR_PIN) && E3_DIR_PIN >= 0
901
+  #if HAS_E3_DIR
866 902
     E3_DIR_INIT;
867 903
   #endif
868 904
 
869 905
   //Initialize Enable Pins - steppers default to disabled.
870 906
 
871
-  #if defined(X_ENABLE_PIN) && X_ENABLE_PIN >= 0
907
+  #if HAS_X_ENABLE
872 908
     X_ENABLE_INIT;
873 909
     if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH);
874 910
   #endif
875
-  #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN >= 0
911
+  #if HAS_X2_ENABLE
876 912
     X2_ENABLE_INIT;
877 913
     if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH);
878 914
   #endif
879
-  #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN >= 0
915
+  #if HAS_Y_ENABLE
880 916
     Y_ENABLE_INIT;
881 917
     if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH);
882 918
 	
883
-	#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_ENABLE_PIN) && Y2_ENABLE_PIN >= 0
919
+	#if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE
884 920
 	  Y2_ENABLE_INIT;
885 921
 	  if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH);
886 922
 	#endif
887 923
   #endif
888
-  #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN >= 0
924
+  #if HAS_Z_ENABLE
889 925
     Z_ENABLE_INIT;
890 926
     if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH);
891 927
 
892
-    #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_ENABLE_PIN) && Z2_ENABLE_PIN >= 0
928
+    #if defined(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_ENABLE
893 929
       Z2_ENABLE_INIT;
894 930
       if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH);
895 931
     #endif
896 932
   #endif
897
-  #if defined(E0_ENABLE_PIN) && E0_ENABLE_PIN >= 0
933
+  #if HAS_E0_ENABLE
898 934
     E0_ENABLE_INIT;
899 935
     if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH);
900 936
   #endif
901
-  #if defined(E1_ENABLE_PIN) && E1_ENABLE_PIN >= 0
937
+  #if HAS_E1_ENABLE
902 938
     E1_ENABLE_INIT;
903 939
     if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH);
904 940
   #endif
905
-  #if defined(E2_ENABLE_PIN) && E2_ENABLE_PIN >= 0
941
+  #if HAS_E2_ENABLE
906 942
     E2_ENABLE_INIT;
907 943
     if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH);
908 944
   #endif
909
-  #if defined(E3_ENABLE_PIN) && E3_ENABLE_PIN >= 0
945
+  #if HAS_E3_ENABLE
910 946
     E3_ENABLE_INIT;
911 947
     if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH);
912 948
   #endif
913 949
 
914 950
   //endstops and pullups
915 951
 
916
-  #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
952
+  #if HAS_X_MIN
917 953
     SET_INPUT(X_MIN_PIN);
918 954
     #ifdef ENDSTOPPULLUP_XMIN
919 955
       WRITE(X_MIN_PIN,HIGH);
920 956
     #endif
921 957
   #endif
922 958
 
923
-  #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
959
+  #if HAS_Y_MIN
924 960
     SET_INPUT(Y_MIN_PIN);
925 961
     #ifdef ENDSTOPPULLUP_YMIN
926 962
       WRITE(Y_MIN_PIN,HIGH);
927 963
     #endif
928 964
   #endif
929 965
 
930
-  #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
966
+  #if HAS_Z_MIN
931 967
     SET_INPUT(Z_MIN_PIN);
932 968
     #ifdef ENDSTOPPULLUP_ZMIN
933 969
       WRITE(Z_MIN_PIN,HIGH);
934 970
     #endif
935 971
   #endif
936 972
 
937
-  #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
973
+  #if HAS_X_MAX
938 974
     SET_INPUT(X_MAX_PIN);
939 975
     #ifdef ENDSTOPPULLUP_XMAX
940 976
       WRITE(X_MAX_PIN,HIGH);
941 977
     #endif
942 978
   #endif
943 979
 
944
-  #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
980
+  #if HAS_Y_MAX
945 981
     SET_INPUT(Y_MAX_PIN);
946 982
     #ifdef ENDSTOPPULLUP_YMAX
947 983
       WRITE(Y_MAX_PIN,HIGH);
948 984
     #endif
949 985
   #endif
950 986
 
951
-  #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
987
+  #if HAS_Z_MAX
952 988
     SET_INPUT(Z_MAX_PIN);
953 989
     #ifdef ENDSTOPPULLUP_ZMAX
954 990
       WRITE(Z_MAX_PIN,HIGH);
955 991
     #endif
956 992
   #endif
957 993
 
958
-  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
994
+  #if HAS_Z2_MAX
959 995
     SET_INPUT(Z2_MAX_PIN);
960 996
     #ifdef ENDSTOPPULLUP_ZMAX
961 997
       WRITE(Z2_MAX_PIN,HIGH);
962 998
     #endif
963 999
   #endif  
964 1000
   
1001
+#if (defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0) && defined(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used.
1002
+  SET_INPUT(Z_PROBE_PIN);
1003
+  #ifdef ENDSTOPPULLUP_ZPROBE
1004
+    WRITE(Z_PROBE_PIN,HIGH);
1005
+  #endif
1006
+#endif
1007
+
965 1008
   #define AXIS_INIT(axis, AXIS, PIN) \
966 1009
     AXIS ##_STEP_INIT; \
967 1010
     AXIS ##_STEP_WRITE(INVERT_## PIN ##_STEP_PIN); \
@@ -970,36 +1013,36 @@ void st_init() {
970 1013
   #define E_AXIS_INIT(NUM) AXIS_INIT(e## NUM, E## NUM, E)
971 1014
 
972 1015
   // Initialize Step Pins
973
-  #if defined(X_STEP_PIN) && X_STEP_PIN >= 0
1016
+  #if HAS_X_STEP
974 1017
     AXIS_INIT(x, X, X);
975 1018
   #endif
976
-  #if defined(X2_STEP_PIN) && X2_STEP_PIN >= 0
1019
+  #if HAS_X2_STEP
977 1020
     AXIS_INIT(x, X2, X);
978 1021
   #endif
979
-  #if defined(Y_STEP_PIN) && Y_STEP_PIN >= 0
980
-    #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
981 1024
       Y2_STEP_INIT;
982 1025
       Y2_STEP_WRITE(INVERT_Y_STEP_PIN);
983 1026
     #endif
984 1027
     AXIS_INIT(y, Y, Y);
985 1028
   #endif
986
-  #if defined(Z_STEP_PIN) && Z_STEP_PIN >= 0
987
-    #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
988 1031
       Z2_STEP_INIT;
989 1032
       Z2_STEP_WRITE(INVERT_Z_STEP_PIN);
990 1033
     #endif
991 1034
     AXIS_INIT(z, Z, Z);
992 1035
   #endif
993
-  #if defined(E0_STEP_PIN) && E0_STEP_PIN >= 0
1036
+  #if HAS_E0_STEP
994 1037
     E_AXIS_INIT(0);
995 1038
   #endif
996
-  #if defined(E1_STEP_PIN) && E1_STEP_PIN >= 0
1039
+  #if HAS_E1_STEP
997 1040
     E_AXIS_INIT(1);
998 1041
   #endif
999
-  #if defined(E2_STEP_PIN) && E2_STEP_PIN >= 0
1042
+  #if HAS_E2_STEP
1000 1043
     E_AXIS_INIT(2);
1001 1044
   #endif
1002
-  #if defined(E3_STEP_PIN) && E3_STEP_PIN >= 0
1045
+  #if HAS_E3_STEP
1003 1046
     E_AXIS_INIT(3);
1004 1047
   #endif
1005 1048
 
@@ -1084,13 +1127,7 @@ long st_get_position(uint8_t axis) {
1084 1127
 
1085 1128
 void finishAndDisableSteppers() {
1086 1129
   st_synchronize();
1087
-  disable_x();
1088
-  disable_y();
1089
-  disable_z();
1090
-  disable_e0();
1091
-  disable_e1();
1092
-  disable_e2();
1093
-  disable_e3();
1130
+  disable_all_steppers();
1094 1131
 }
1095 1132
 
1096 1133
 void quickStop() {
@@ -1220,12 +1257,12 @@ void digipot_current(uint8_t driver, int current) {
1220 1257
 }
1221 1258
 
1222 1259
 void microstep_init() {
1223
-  #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0
1260
+  #if HAS_MICROSTEPS_E1
1224 1261
     pinMode(E1_MS1_PIN,OUTPUT);
1225
-    pinMode(E1_MS2_PIN,OUTPUT); 
1262
+    pinMode(E1_MS2_PIN,OUTPUT);
1226 1263
   #endif
1227 1264
 
1228
-  #if defined(X_MS1_PIN) && X_MS1_PIN >= 0
1265
+  #if HAS_MICROSTEPS
1229 1266
     pinMode(X_MS1_PIN,OUTPUT);
1230 1267
     pinMode(X_MS2_PIN,OUTPUT);  
1231 1268
     pinMode(Y_MS1_PIN,OUTPUT);
@@ -1246,7 +1283,7 @@ void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) {
1246 1283
     case 1: digitalWrite(Y_MS1_PIN, ms1); break;
1247 1284
     case 2: digitalWrite(Z_MS1_PIN, ms1); break;
1248 1285
     case 3: digitalWrite(E0_MS1_PIN, ms1); break;
1249
-    #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0
1286
+    #if HAS_MICROSTEPS_E1
1250 1287
       case 4: digitalWrite(E1_MS1_PIN, ms1); break;
1251 1288
     #endif
1252 1289
   }
@@ -1285,7 +1322,7 @@ void microstep_readings() {
1285 1322
   SERIAL_PROTOCOLPGM("E0: ");
1286 1323
   SERIAL_PROTOCOL(digitalRead(E0_MS1_PIN));
1287 1324
   SERIAL_PROTOCOLLN(digitalRead(E0_MS2_PIN));
1288
-  #if defined(E1_MS1_PIN) && E1_MS1_PIN >= 0
1325
+  #if HAS_MICROSTEPS_E1
1289 1326
     SERIAL_PROTOCOLPGM("E1: ");
1290 1327
     SERIAL_PROTOCOL(digitalRead(E1_MS1_PIN));
1291 1328
     SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN));

+ 70
- 78
Marlin/temperature.cpp View File

@@ -1,5 +1,5 @@
1 1
 /*
2
-  temperature.c - temperature control
2
+  temperature.cpp - temperature control
3 3
   Part of Marlin
4 4
   
5 5
  Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,18 +16,7 @@
16 16
  
17 17
  You should have received a copy of the GNU General Public License
18 18
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
- */
20
-
21
-/*
22
- This firmware is a mashup between Sprinter and grbl.
23
-  (https://github.com/kliment/Sprinter)
24
-  (https://github.com/simen/grbl/tree)
25
- 
26
- It has preliminary support for Matthew Roberts advance algorithm 
27
-    http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
28
-
29
- */
30
-
19
+*/
31 20
 
32 21
 #include "Marlin.h"
33 22
 #include "ultralcd.h"
@@ -87,14 +76,14 @@ unsigned char soft_pwm_bed;
87 76
 #define HAS_HEATER_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0)
88 77
 #define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0)
89 78
 #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
90
-  static bool thermal_runaway = false;
91
-  void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
79
+  enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway };
80
+  void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
92 81
   #if HAS_HEATER_THERMAL_PROTECTION
93
-    static int thermal_runaway_state_machine[4]; // = {0,0,0,0};
82
+    static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset };
94 83
     static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0};
95 84
   #endif
96 85
   #if HAS_BED_THERMAL_PROTECTION
97
-    static int thermal_runaway_bed_state_machine;
86
+    static TRState thermal_runaway_bed_state_machine = TRReset;
98 87
     static unsigned long thermal_runaway_bed_timer;
99 88
   #endif
100 89
 #endif
@@ -238,7 +227,7 @@ void PID_autotune(float temp, int extruder, int ncycles)
238 227
     soft_pwm[extruder] = bias = d = PID_MAX / 2;
239 228
 
240 229
   // PID Tuning loop
241
-  for(;;) {
230
+  for (;;) {
242 231
 
243 232
     unsigned long ms = millis();
244 233
 
@@ -609,7 +598,7 @@ void manage_heater() {
609 598
   // Loop through all extruders
610 599
   for (int e = 0; e < EXTRUDERS; e++) {
611 600
 
612
-    #if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
601
+    #if HAS_HEATER_THERMAL_PROTECTION
613 602
       thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_RUNAWAY_PROTECTION_PERIOD, THERMAL_RUNAWAY_PROTECTION_HYSTERESIS);
614 603
     #endif
615 604
 
@@ -637,7 +626,7 @@ void manage_heater() {
637 626
         disable_heater();
638 627
         _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP));
639 628
       }
640
-    #endif //TEMP_SENSOR_1_AS_REDUNDANT
629
+    #endif // TEMP_SENSOR_1_AS_REDUNDANT
641 630
 
642 631
   } // Extruders Loop
643 632
 
@@ -656,7 +645,7 @@ void manage_heater() {
656 645
   #if TEMP_SENSOR_BED != 0
657 646
   
658 647
     #if HAS_BED_THERMAL_PROTECTION
659
-      thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, 9, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS);
648
+      thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS);
660 649
     #endif
661 650
 
662 651
     #ifdef PIDTEMPBED
@@ -1014,69 +1003,72 @@ void setWatch() {
1014 1003
 }
1015 1004
 
1016 1005
 #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1017
-void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc)
1018
-{
1019
-/*
1020
-      SERIAL_ECHO_START;
1021
-      SERIAL_ECHO("Thermal Thermal Runaway Running. Heater ID:");
1022
-      SERIAL_ECHO(heater_id);
1023
-      SERIAL_ECHO(" ;  State:");
1024
-      SERIAL_ECHO(*state);
1025
-      SERIAL_ECHO(" ;  Timer:");
1026
-      SERIAL_ECHO(*timer);
1027
-      SERIAL_ECHO(" ;  Temperature:");
1028
-      SERIAL_ECHO(temperature);
1029
-      SERIAL_ECHO(" ;  Target Temp:");
1030
-      SERIAL_ECHO(target_temperature);
1031
-      SERIAL_ECHOLN("");    
1032
-*/
1033
-  if ((target_temperature == 0) || thermal_runaway)
1034
-  {
1035
-    *state = 0;
1036
-    *timer = 0;
1037
-    return;
1038
-  }
1039
-  switch (*state)
1040
-  {
1041
-    case 0: // "Heater Inactive" state
1042
-      if (target_temperature > 0) *state = 1;
1043
-      break;
1044
-    case 1: // "First Heating" state
1045
-      if (temperature >= target_temperature) *state = 2;
1046
-      break;
1047
-    case 2: // "Temperature Stable" state
1048
-    {
1049
-      unsigned long ms = millis();
1050
-      if (temperature >= (target_temperature - hysteresis_degc))
1051
-      {
1052
-        *timer = ms;
1053
-      } 
1054
-      else if ( (ms - *timer) > ((unsigned long) period_seconds) * 1000)
1055
-      {
1006
+
1007
+  void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
1008
+
1009
+    static float tr_target_temperature[EXTRUDERS+1] = { 0.0 };
1010
+
1011
+    /*
1012
+        SERIAL_ECHO_START;
1013
+        SERIAL_ECHOPGM("Thermal Thermal Runaway Running. Heater ID: ");
1014
+        if (heater_id < 0) SERIAL_ECHOPGM("bed"); else SERIAL_ECHOPGM(heater_id);
1015
+        SERIAL_ECHOPGM(" ;  State:");
1016
+        SERIAL_ECHOPGM(*state);
1017
+        SERIAL_ECHOPGM(" ;  Timer:");
1018
+        SERIAL_ECHOPGM(*timer);
1019
+        SERIAL_ECHOPGM(" ;  Temperature:");
1020
+        SERIAL_ECHOPGM(temperature);
1021
+        SERIAL_ECHOPGM(" ;  Target Temp:");
1022
+        SERIAL_ECHOPGM(target_temperature);
1023
+        SERIAL_EOL;
1024
+    */
1025
+
1026
+    int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS;
1027
+
1028
+    // If the target temperature changes, restart
1029
+    if (tr_target_temperature[heater_index] != target_temperature)
1030
+      *state = TRReset;
1031
+
1032
+    switch (*state) {
1033
+      case TRReset:
1034
+        *timer = 0;
1035
+        *state = TRInactive;
1036
+        break;
1037
+      // Inactive state waits for a target temperature to be set
1038
+      case TRInactive:
1039
+        if (target_temperature > 0) {
1040
+          tr_target_temperature[heater_index] = target_temperature;
1041
+          *state = TRFirstHeating;
1042
+        }
1043
+        break;
1044
+      // When first heating, wait for the temperature to be reached then go to Stable state
1045
+      case TRFirstHeating:
1046
+        if (temperature >= tr_target_temperature[heater_index]) *state = TRStable;
1047
+        break;
1048
+      // While the temperature is stable watch for a bad temperature
1049
+      case TRStable:
1050
+        // If the temperature is over the target (-hysteresis) restart the timer
1051
+        if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc)
1052
+          *timer = millis();
1053
+          // If the timer goes too long without a reset, trigger shutdown
1054
+        else if (millis() > *timer + period_seconds * 1000UL)
1055
+          *state = TRRunaway;
1056
+        break;
1057
+      case TRRunaway:
1056 1058
         SERIAL_ERROR_START;
1057 1059
         SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
1058
-        SERIAL_ERRORLN((int)heater_id);
1059
-        LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); // translatable
1060
-        thermal_runaway = true;
1061
-        while(1)
1062
-        {
1063
-          disable_heater();
1064
-          disable_x();
1065
-          disable_y();
1066
-          disable_z();
1067
-          disable_e0();
1068
-          disable_e1();
1069
-          disable_e2();
1070
-          disable_e3();
1060
+        if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
1061
+        LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
1062
+        disable_heater();
1063
+        disable_all_steppers();
1064
+        for (;;) {
1071 1065
           manage_heater();
1072 1066
           lcd_update();
1073 1067
         }
1074
-      }
1075
-    } break;
1068
+    }
1076 1069
   }
1077
-}
1078
-#endif //THERMAL_RUNAWAY_PROTECTION_PERIOD
1079 1070
 
1071
+#endif // HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1080 1072
 
1081 1073
 void disable_heater() {
1082 1074
   for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i);
@@ -1559,7 +1551,7 @@ ISR(TIMER0_COMPB_vect) {
1559 1551
       #else
1560 1552
         #define GE2 >=
1561 1553
       #endif
1562
-      if (current_temperature_raw[2] GE2 (maxttemp_raw[2]) max_temp_error(2);
1554
+      if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2);
1563 1555
       if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2);
1564 1556
     #endif // TEMP_SENSOR_2
1565 1557
 

+ 18
- 32
Marlin/temperature.h View File

@@ -18,8 +18,8 @@
18 18
   along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
19 19
 */
20 20
 
21
-#ifndef temperature_h
22
-#define temperature_h 
21
+#ifndef TEMPERATURE_H
22
+#define TEMPERATURE_H 
23 23
 
24 24
 #include "Marlin.h"
25 25
 #include "planner.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
 
@@ -72,11 +72,11 @@ extern float current_temperature_bed;
72 72
   float unscalePID_d(float d);
73 73
 
74 74
 #endif
75
+
75 76
 #ifdef PIDTEMPBED
76 77
   extern float bedKp,bedKi,bedKd;
77 78
 #endif
78 79
   
79
-  
80 80
 #ifdef BABYSTEPPING
81 81
   extern volatile int babystepsTodo[3];
82 82
 #endif
@@ -105,40 +105,27 @@ FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_tempe
105 105
 FORCE_INLINE bool isCoolingHotend(uint8_t extruder) { return target_temperature[extruder] < current_temperature[extruder]; }
106 106
 FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; }
107 107
 
108
-#define degHotend0() degHotend(0)
109
-#define degTargetHotend0() degTargetHotend(0)
110
-#define setTargetHotend0(_celsius) setTargetHotend((_celsius), 0)
111
-#define isHeatingHotend0() isHeatingHotend(0)
112
-#define isCoolingHotend0() isCoolingHotend(0)
108
+#define HOTEND_ROUTINES(NR) \
109
+  FORCE_INLINE float degHotend##NR() { return degHotend(NR); } \
110
+  FORCE_INLINE float degTargetHotend##NR() { return degTargetHotend(NR); } \
111
+  FORCE_INLINE void setTargetHotend##NR(const float c) { setTargetHotend(c, NR); } \
112
+  FORCE_INLINE bool isHeatingHotend##NR() { return isHeatingHotend(NR); } \
113
+  FORCE_INLINE bool isCoolingHotend##NR() { return isCoolingHotend(NR); }
114
+HOTEND_ROUTINES(0);
113 115
 #if EXTRUDERS > 1
114
-  #define degHotend1() degHotend(1)
115
-  #define degTargetHotend1() degTargetHotend(1)
116
-  #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
117
-  #define isHeatingHotend1() isHeatingHotend(1)
118
-  #define isCoolingHotend1() isCoolingHotend(1)
116
+  HOTEND_ROUTINES(1);
119 117
 #else
120
-  #define setTargetHotend1(_celsius) do{}while(0)
118
+  #define setTargetHotend1(c) do{}while(0)
121 119
 #endif
122 120
 #if EXTRUDERS > 2
123
-  #define degHotend2() degHotend(2)
124
-  #define degTargetHotend2() degTargetHotend(2)
125
-  #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
126
-  #define isHeatingHotend2() isHeatingHotend(2)
127
-  #define isCoolingHotend2() isCoolingHotend(2)
121
+  HOTEND_ROUTINES(2);
128 122
 #else
129
-  #define setTargetHotend2(_celsius) do{}while(0)
123
+  #define setTargetHotend2(c) do{}while(0)
130 124
 #endif
131 125
 #if EXTRUDERS > 3
132
-  #define degHotend3() degHotend(3)
133
-  #define degTargetHotend3() degTargetHotend(3)
134
-  #define setTargetHotend3(_celsius) setTargetHotend((_celsius), 3)
135
-  #define isHeatingHotend3() isHeatingHotend(3)
136
-  #define isCoolingHotend3() isCoolingHotend(3)
126
+  HOTEND_ROUTINES(3);
137 127
 #else
138
-  #define setTargetHotend3(_celsius) do{}while(0)
139
-#endif
140
-#if EXTRUDERS > 4
141
-  #error Invalid number of extruders
128
+  #define setTargetHotend3(c) do{}while(0)
142 129
 #endif
143 130
 
144 131
 int getHeaterPower(int heater);
@@ -161,5 +148,4 @@ FORCE_INLINE void autotempShutdown() {
161 148
   #endif
162 149
 }
163 150
 
164
-
165
-#endif
151
+#endif // TEMPERATURE_H

+ 26
- 27
Marlin/ultralcd.cpp View File

@@ -262,8 +262,7 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool
262 262
 }
263 263
 
264 264
 /* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */
265
-static void lcd_status_screen()
266
-{
265
+static void lcd_status_screen() {
267 266
 	encoderRateMultiplierEnabled = false;
268 267
 
269 268
   #ifdef LCD_PROGRESS_BAR
@@ -296,15 +295,7 @@ static void lcd_status_screen()
296 295
     #endif
297 296
   #endif //LCD_PROGRESS_BAR
298 297
 
299
-  if (lcd_status_update_delay)
300
-    lcd_status_update_delay--;
301
-  else
302
-    lcdDrawUpdate = 1;
303
-
304
-  if (lcdDrawUpdate) {
305 298
     lcd_implementation_status_screen();
306
-    lcd_status_update_delay = 10;   /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
307
-  }
308 299
 
309 300
 #ifdef ULTIPANEL
310 301
 
@@ -1298,7 +1289,7 @@ void lcd_update() {
1298 1289
       }
1299 1290
     }
1300 1291
   #endif//CARDINSERTED
1301
-
1292
+  
1302 1293
   uint32_t ms = millis();
1303 1294
   if (ms > lcd_next_update_millis) {
1304 1295
 
@@ -1349,27 +1340,36 @@ void lcd_update() {
1349 1340
             } // encoderRateMultiplierEnabled
1350 1341
           #endif //ENCODER_RATE_MULTIPLIER
1351 1342
 
1352
-          lcdDrawUpdate = 1;
1353 1343
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
1354 1344
           encoderDiff = 0;
1355 1345
         }
1356 1346
         timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS;
1347
+        lcdDrawUpdate = 1;
1357 1348
       }
1358
-
1359 1349
     #endif //ULTIPANEL
1360 1350
 
1351
+    if (currentMenu == lcd_status_screen) {
1352
+      if (!lcd_status_update_delay) {
1353
+        lcdDrawUpdate = 1;
1354
+        lcd_status_update_delay = 10;   /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
1355
+      }
1356
+      else {
1357
+        lcd_status_update_delay--;
1358
+      }
1359
+    }
1361 1360
     #ifdef DOGLCD  // Changes due to different driver architecture of the DOGM display
1362
-      blink++;     // Variable for fan animation and alive dot
1363
-      u8g.firstPage();
1364
-      do {
1365
-        lcd_setFont(FONT_MENU);
1366
-        u8g.setPrintPos(125, 0);
1367
-        if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1368
-        u8g.drawPixel(127, 63); // draw alive dot
1369
-        u8g.setColorIndex(1); // black on white
1370
-        (*currentMenu)();
1371
-        if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next()
1372
-      } while( u8g.nextPage() );
1361
+      if (lcdDrawUpdate) {
1362
+        blink++;     // Variable for fan animation and alive dot
1363
+        u8g.firstPage();
1364
+        do {
1365
+          lcd_setFont(FONT_MENU);
1366
+          u8g.setPrintPos(125, 0);
1367
+          if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1368
+          u8g.drawPixel(127, 63); // draw alive dot
1369
+          u8g.setColorIndex(1); // black on white
1370
+          (*currentMenu)();
1371
+        } while( u8g.nextPage() );
1372
+      }
1373 1373
     #else
1374 1374
       (*currentMenu)();
1375 1375
     #endif
@@ -1789,7 +1789,7 @@ char *ftostr52(const float &x) {
1789 1789
   return conv;
1790 1790
 }
1791 1791
 
1792
-#if defined(MANUAL_BED_LEVELING)
1792
+#ifdef MANUAL_BED_LEVELING
1793 1793
 static int _lcd_level_bed_position;
1794 1794
 static void _lcd_level_bed()
1795 1795
 {
@@ -1849,8 +1849,7 @@ static void _lcd_level_bed_homing()
1849 1849
     lcd_goto_menu(_lcd_level_bed);
1850 1850
   }
1851 1851
 }
1852
-static void lcd_level_bed()
1853
-{
1852
+static void lcd_level_bed() {
1854 1853
   axis_known_position[X_AXIS] = false;
1855 1854
   axis_known_position[Y_AXIS] = false;
1856 1855
   axis_known_position[Z_AXIS] = false;

+ 8
- 8
Marlin/ultralcd.h View File

@@ -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)

+ 2
- 2
Marlin/vector_3.cpp View File

@@ -125,9 +125,9 @@ void matrix_3x3::debug(const char title[]) {
125 125
   int count = 0;
126 126
   for(int i=0; i<3; i++) {
127 127
     for(int j=0; j<3; j++) {
128
-      if (matrix[count] >= 0.0) SERIAL_PROTOCOLPGM("+");
128
+      if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+');
129 129
       SERIAL_PROTOCOL_F(matrix[count], 6);
130
-      SERIAL_PROTOCOLPGM(" ");
130
+      SERIAL_PROTOCOLCHAR(' ');
131 131
       count++;
132 132
     }
133 133
     SERIAL_EOL;

+ 7
- 7
README.md View File

@@ -18,8 +18,8 @@
18 18
 ## Quick Information
19 19
 
20 20
 This is a firmware for reprap single-processor electronics setups.
21
-It also works on the Ultimaker PCB. It supports printing from SD card+Folders, and look-ahead trajectory planning.
22
-This firmware is a mashup between [Sprinter](https://github.com/kliment/Sprinter), [grbl](https://github.com/simen/grbl) and many original parts.
21
+It also works on the Ultimaker PCB. It supports printing from SD card+Folders and look-ahead trajectory planning.
22
+This firmware is a mashup between [Sprinter](https://github.com/kliment/Sprinter), [grbl](https://github.com/simen/grbl), and many original parts.
23 23
 
24 24
 ## Current Status: Bug Fixing
25 25
 
@@ -31,18 +31,18 @@ We are actively looking for testers. So please try the current development versi
31 31
 
32 32
 ## Contact
33 33
 
34
-__IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware)
34
+__Google Hangout:__ <a href="https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua" target="_blank">Hagnout</a>
35 35
 
36 36
 ## Credits
37 37
 
38 38
 The current Marlin dev team consists of:
39 39
 
40
- - Erik van der Zalm ([@ErikZalm](https://github.com/ErikZalm))
41
- - [@daid](https://github.com/daid)
40
+ - Scott Lahteine [@thinkyhead]
41
+ - 
42 42
 
43 43
 Sprinters lead developers are Kliment and caru.
44
-Grbls lead developer is Simen Svale Skogsrud.
45
-Sonney Jeon (Chamnit) improved some parts of grbl
44
+Grbl's lead developer is Simen Svale Skogsrud.
45
+Sonney Jeon (Chamnit) improved some parts of grbl.
46 46
 A fork by bkubicek for the Ultimaker was merged.
47 47
 
48 48
 More features have been added by:

Loading…
Cancel
Save