Introduce axis_homed
Introduce additional variable axis_homed to replace axix_known_position when the coordinate display should indicate the axis is not homed. This is to distinguish between "not homed" and "inexact position possible because stepper was disabled". # Conflicts: # Marlin/ultralcd_implementation_hitachi_HD44780.h solved
This commit is contained in:
parent
e736779d7e
commit
051325ccd7
4 changed files with 9 additions and 6 deletions
|
@ -259,6 +259,7 @@ extern float home_offset[3]; // axis[n].home_offset
|
|||
extern float min_pos[3]; // axis[n].min_pos
|
||||
extern float max_pos[3]; // axis[n].max_pos
|
||||
extern bool axis_known_position[3]; // axis[n].is_known
|
||||
extern bool axis_homed[3]; // axis[n].is_homed
|
||||
|
||||
#if ENABLED(DELTA)
|
||||
extern float delta[3];
|
||||
|
|
|
@ -245,6 +245,7 @@ static float feedrate = 1500.0, saved_feedrate;
|
|||
float current_position[NUM_AXIS] = { 0.0 };
|
||||
static float destination[NUM_AXIS] = { 0.0 };
|
||||
bool axis_known_position[3] = { false };
|
||||
bool axis_homed[3] = { false };
|
||||
|
||||
static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
|
||||
|
||||
|
@ -1981,6 +1982,7 @@ static void homeaxis(AxisEnum axis) {
|
|||
feedrate = 0.0;
|
||||
endstops_hit_on_purpose(); // clear endstop hit flags
|
||||
axis_known_position[axis] = true;
|
||||
axis_homed[axis] = true;
|
||||
|
||||
#if ENABLED(Z_PROBE_SLED)
|
||||
// bring Z probe back
|
||||
|
|
|
@ -352,7 +352,7 @@ static void lcd_implementation_status_screen() {
|
|||
u8g.drawPixel(8, XYZ_BASELINE - 5);
|
||||
u8g.drawPixel(8, XYZ_BASELINE - 3);
|
||||
u8g.setPrintPos(10, XYZ_BASELINE);
|
||||
if (axis_known_position[X_AXIS] || (blink & 1))
|
||||
if (axis_homed[X_AXIS] || (blink & 1))
|
||||
lcd_print(ftostr31ns(current_position[X_AXIS]));
|
||||
else
|
||||
lcd_printPGM(PSTR("---"));
|
||||
|
@ -361,7 +361,7 @@ static void lcd_implementation_status_screen() {
|
|||
u8g.drawPixel(49, XYZ_BASELINE - 5);
|
||||
u8g.drawPixel(49, XYZ_BASELINE - 3);
|
||||
u8g.setPrintPos(51, XYZ_BASELINE);
|
||||
if (axis_known_position[Y_AXIS] || (blink & 1))
|
||||
if (axis_homed[Y_AXIS] || (blink & 1))
|
||||
lcd_print(ftostr31ns(current_position[Y_AXIS]));
|
||||
else
|
||||
lcd_printPGM(PSTR("---"));
|
||||
|
@ -370,7 +370,7 @@ static void lcd_implementation_status_screen() {
|
|||
u8g.drawPixel(89, XYZ_BASELINE - 5);
|
||||
u8g.drawPixel(89, XYZ_BASELINE - 3);
|
||||
u8g.setPrintPos(91, XYZ_BASELINE);
|
||||
if (axis_known_position[Z_AXIS] || (blink & 1))
|
||||
if (axis_homed[Z_AXIS] || (blink & 1))
|
||||
lcd_print(ftostr32sp(current_position[Z_AXIS]));
|
||||
else
|
||||
lcd_printPGM(PSTR("---.--"));
|
||||
|
|
|
@ -617,13 +617,13 @@ static void lcd_implementation_status_screen() {
|
|||
#else
|
||||
|
||||
lcd.print('X');
|
||||
if (axis_known_position[X_AXIS] || (blink & 1))
|
||||
if (axis_homed[X_AXIS] || (blink & 1))
|
||||
lcd.print(ftostr4sign(current_position[X_AXIS]));
|
||||
else
|
||||
lcd_printPGM(PSTR(" ---"));
|
||||
|
||||
lcd_printPGM(PSTR(" Y"));
|
||||
if (axis_known_position[Y_AXIS] || (blink & 1))
|
||||
if (axis_homed[Y_AXIS] || (blink & 1))
|
||||
lcd.print(ftostr4sign(current_position[Y_AXIS]));
|
||||
else
|
||||
lcd_printPGM(PSTR(" ---"));
|
||||
|
@ -634,7 +634,7 @@ static void lcd_implementation_status_screen() {
|
|||
|
||||
lcd.setCursor(LCD_WIDTH - 8, 1);
|
||||
lcd_printPGM(PSTR("Z "));
|
||||
if (axis_known_position[Z_AXIS] || (blink & 1))
|
||||
if (axis_homed[Z_AXIS] || (blink & 1))
|
||||
lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
|
||||
else
|
||||
lcd_printPGM(PSTR("---.--"));
|
||||
|
|
Reference in a new issue