|
@@ -562,7 +562,7 @@ bool code_seen(char code)
|
562
|
562
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
|
563
|
563
|
st_synchronize();\
|
564
|
564
|
\
|
565
|
|
- current_position[LETTER##_AXIS] = (LETTER##_HOME_DIR == -1) ? LETTER##_HOME_POS : LETTER##_MAX_LENGTH;\
|
|
565
|
+ current_position[LETTER##_AXIS] = LETTER##_HOME_POS;\
|
566
|
566
|
destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\
|
567
|
567
|
feedrate = 0.0;\
|
568
|
568
|
endstops_hit_on_purpose();\
|
|
@@ -656,6 +656,13 @@ void process_commands()
|
656
|
656
|
}
|
657
|
657
|
feedrate = 0.0;
|
658
|
658
|
home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
|
|
659
|
+
|
|
660
|
+ #if Z_HOME_DIR > 0 // If homing away from BED do Z first
|
|
661
|
+ if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
|
|
662
|
+ HOMEAXIS(Z);
|
|
663
|
+ }
|
|
664
|
+ #endif
|
|
665
|
+
|
659
|
666
|
#ifdef QUICK_HOME
|
660
|
667
|
if((home_all_axis)||( code_seen(axis_codes[X_AXIS]) && code_seen(axis_codes[Y_AXIS])) ) //first diagonal move
|
661
|
668
|
{
|
|
@@ -669,8 +676,8 @@ void process_commands()
|
669
|
676
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
670
|
677
|
st_synchronize();
|
671
|
678
|
|
672
|
|
- current_position[X_AXIS] = (X_HOME_DIR == -1) ? X_HOME_POS : X_MAX_LENGTH;
|
673
|
|
- current_position[Y_AXIS] = (Y_HOME_DIR == -1) ? Y_HOME_POS : Y_MAX_LENGTH;
|
|
679
|
+ current_position[X_AXIS] = X_HOME_POS;
|
|
680
|
+ current_position[Y_AXIS] = Y_HOME_POS;
|
674
|
681
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
675
|
682
|
destination[X_AXIS] = current_position[X_AXIS];
|
676
|
683
|
destination[Y_AXIS] = current_position[Y_AXIS];
|
|
@@ -687,12 +694,14 @@ void process_commands()
|
687
|
694
|
}
|
688
|
695
|
|
689
|
696
|
if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
|
690
|
|
- HOMEAXIS(Y);
|
|
697
|
+ HOMEAXIS(Y);
|
691
|
698
|
}
|
692
|
699
|
|
|
700
|
+ #if Z_HOME_DIR < 0 // If homing towards BED do Z last
|
693
|
701
|
if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
|
694
|
702
|
HOMEAXIS(Z);
|
695
|
703
|
}
|
|
704
|
+ #endif
|
696
|
705
|
|
697
|
706
|
if(code_seen(axis_codes[X_AXIS]))
|
698
|
707
|
{
|
|
@@ -1533,15 +1542,15 @@ void get_arc_coordinates()
|
1533
|
1542
|
void prepare_move()
|
1534
|
1543
|
{
|
1535
|
1544
|
if (min_software_endstops) {
|
1536
|
|
- if (destination[X_AXIS] < X_HOME_POS) destination[X_AXIS] = X_HOME_POS;
|
1537
|
|
- if (destination[Y_AXIS] < Y_HOME_POS) destination[Y_AXIS] = Y_HOME_POS;
|
1538
|
|
- if (destination[Z_AXIS] < Z_HOME_POS) destination[Z_AXIS] = Z_HOME_POS;
|
|
1545
|
+ if (destination[X_AXIS] < X_MIN_POS) destination[X_AXIS] = X_MIN_POS;
|
|
1546
|
+ if (destination[Y_AXIS] < Y_MIN_POS) destination[Y_AXIS] = Y_MIN_POS;
|
|
1547
|
+ if (destination[Z_AXIS] < Z_MIN_POS) destination[Z_AXIS] = Z_MIN_POS;
|
1539
|
1548
|
}
|
1540
|
1549
|
|
1541
|
1550
|
if (max_software_endstops) {
|
1542
|
|
- if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH;
|
1543
|
|
- if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH;
|
1544
|
|
- if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH;
|
|
1551
|
+ if (destination[X_AXIS] > X_MAX_POS) destination[X_AXIS] = X_MAX_POS;
|
|
1552
|
+ if (destination[Y_AXIS] > Y_MAX_POS) destination[Y_AXIS] = Y_MAX_POS;
|
|
1553
|
+ if (destination[Z_AXIS] > Z_MAX_POS) destination[Z_AXIS] = Z_MAX_POS;
|
1545
|
1554
|
}
|
1546
|
1555
|
previous_millis_cmd = millis();
|
1547
|
1556
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder);
|