|
@@ -203,7 +203,6 @@
|
203
|
203
|
#endif
|
204
|
204
|
|
205
|
205
|
float homing_feedrate[] = HOMING_FEEDRATE;
|
206
|
|
-int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
|
207
|
206
|
bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
|
208
|
207
|
int feedmultiply = 100; //100->1 200->2
|
209
|
208
|
int saved_feedmultiply;
|
|
@@ -989,6 +988,15 @@ static void axis_is_at_home(int axis) {
|
989
|
988
|
/**
|
990
|
989
|
* Some planner shorthand inline functions
|
991
|
990
|
*/
|
|
991
|
+inline void set_homing_bump_feedrate(AxisEnum axis) {
|
|
992
|
+ const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
|
|
993
|
+ if (homing_bump_divisor[axis] >= 1)
|
|
994
|
+ feedrate = homing_feedrate[axis] / homing_bump_divisor[axis];
|
|
995
|
+ else {
|
|
996
|
+ feedrate = homing_feedrate[axis] / 10;
|
|
997
|
+ SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1");
|
|
998
|
+ }
|
|
999
|
+}
|
992
|
1000
|
inline void line_to_current_position() {
|
993
|
1001
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder);
|
994
|
1002
|
}
|
|
@@ -1119,12 +1127,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
|
1119
|
1127
|
endstops_hit_on_purpose(); // clear endstop hit flags
|
1120
|
1128
|
|
1121
|
1129
|
// move back down slowly to find bed
|
1122
|
|
- if (homing_bump_divisor[Z_AXIS] >= 1)
|
1123
|
|
- feedrate = homing_feedrate[Z_AXIS] / homing_bump_divisor[Z_AXIS];
|
1124
|
|
- else {
|
1125
|
|
- feedrate = homing_feedrate[Z_AXIS] / 10;
|
1126
|
|
- SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less than 1");
|
1127
|
|
- }
|
|
1130
|
+ set_homing_bump_feedrate(Z_AXIS);
|
1128
|
1131
|
|
1129
|
1132
|
zPosition -= home_bump_mm(Z_AXIS) * 2;
|
1130
|
1133
|
line_to_z(zPosition);
|
|
@@ -1437,7 +1440,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
|
1437
|
1440
|
|
1438
|
1441
|
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
|
1439
|
1442
|
|
1440
|
|
-static void homeaxis(int axis) {
|
|
1443
|
+static void homeaxis(AxisEnum axis) {
|
1441
|
1444
|
#define HOMEAXIS_DO(LETTER) \
|
1442
|
1445
|
((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
|
1443
|
1446
|
|
|
@@ -1488,12 +1491,7 @@ static void homeaxis(int axis) {
|
1488
|
1491
|
st_synchronize();
|
1489
|
1492
|
|
1490
|
1493
|
// Slow down the feedrate for the next move
|
1491
|
|
- if (homing_bump_divisor[axis] >= 1)
|
1492
|
|
- feedrate = homing_feedrate[axis] / homing_bump_divisor[axis];
|
1493
|
|
- else {
|
1494
|
|
- feedrate = homing_feedrate[axis] / 10;
|
1495
|
|
- SERIAL_ECHOLNPGM("Warning: The Homing Bump Feedrate Divisor cannot be less than 1");
|
1496
|
|
- }
|
|
1494
|
+ set_homing_bump_feedrate(axis);
|
1497
|
1495
|
|
1498
|
1496
|
// Move slowly towards the endstop until triggered
|
1499
|
1497
|
destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir;
|