Просмотр исходного кода

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
AnHardt 9 лет назад
Родитель
Сommit
051325ccd7

+ 1
- 0
Marlin/Marlin.h Просмотреть файл

@@ -259,6 +259,7 @@ extern float home_offset[3]; // axis[n].home_offset
259 259
 extern float min_pos[3]; // axis[n].min_pos
260 260
 extern float max_pos[3]; // axis[n].max_pos
261 261
 extern bool axis_known_position[3]; // axis[n].is_known
262
+extern bool axis_homed[3]; // axis[n].is_homed
262 263
 
263 264
 #if ENABLED(DELTA)
264 265
   extern float delta[3];

+ 2
- 0
Marlin/Marlin_main.cpp Просмотреть файл

@@ -245,6 +245,7 @@ static float feedrate = 1500.0, saved_feedrate;
245 245
 float current_position[NUM_AXIS] = { 0.0 };
246 246
 static float destination[NUM_AXIS] = { 0.0 };
247 247
 bool axis_known_position[3] = { false };
248
+bool axis_homed[3] = { false };
248 249
 
249 250
 static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
250 251
 
@@ -1981,6 +1982,7 @@ static void homeaxis(AxisEnum axis) {
1981 1982
     feedrate = 0.0;
1982 1983
     endstops_hit_on_purpose(); // clear endstop hit flags
1983 1984
     axis_known_position[axis] = true;
1985
+    axis_homed[axis] = true;
1984 1986
 
1985 1987
     #if ENABLED(Z_PROBE_SLED)
1986 1988
       // bring Z probe back

+ 3
- 3
Marlin/dogm_lcd_implementation.h Просмотреть файл

@@ -352,7 +352,7 @@ static void lcd_implementation_status_screen() {
352 352
   u8g.drawPixel(8, XYZ_BASELINE - 5);
353 353
   u8g.drawPixel(8, XYZ_BASELINE - 3);
354 354
   u8g.setPrintPos(10, XYZ_BASELINE);
355
-  if (axis_known_position[X_AXIS] || (blink & 1))
355
+  if (axis_homed[X_AXIS] || (blink & 1))
356 356
     lcd_print(ftostr31ns(current_position[X_AXIS]));
357 357
   else
358 358
     lcd_printPGM(PSTR("---"));
@@ -361,7 +361,7 @@ static void lcd_implementation_status_screen() {
361 361
   u8g.drawPixel(49, XYZ_BASELINE - 5);
362 362
   u8g.drawPixel(49, XYZ_BASELINE - 3);
363 363
   u8g.setPrintPos(51, XYZ_BASELINE);
364
-  if (axis_known_position[Y_AXIS] || (blink & 1))
364
+  if (axis_homed[Y_AXIS] || (blink & 1))
365 365
     lcd_print(ftostr31ns(current_position[Y_AXIS]));
366 366
   else
367 367
     lcd_printPGM(PSTR("---"));
@@ -370,7 +370,7 @@ static void lcd_implementation_status_screen() {
370 370
   u8g.drawPixel(89, XYZ_BASELINE - 5);
371 371
   u8g.drawPixel(89, XYZ_BASELINE - 3);
372 372
   u8g.setPrintPos(91, XYZ_BASELINE);
373
-  if (axis_known_position[Z_AXIS] || (blink & 1))
373
+  if (axis_homed[Z_AXIS] || (blink & 1))
374 374
     lcd_print(ftostr32sp(current_position[Z_AXIS]));
375 375
   else
376 376
     lcd_printPGM(PSTR("---.--"));

+ 3
- 3
Marlin/ultralcd_implementation_hitachi_HD44780.h Просмотреть файл

@@ -617,13 +617,13 @@ static void lcd_implementation_status_screen() {
617 617
       #else
618 618
 
619 619
         lcd.print('X');
620
-        if (axis_known_position[X_AXIS] || (blink & 1))
620
+        if (axis_homed[X_AXIS] || (blink & 1))
621 621
           lcd.print(ftostr4sign(current_position[X_AXIS]));
622 622
         else
623 623
           lcd_printPGM(PSTR(" ---"));
624 624
 
625 625
         lcd_printPGM(PSTR("  Y"));
626
-        if (axis_known_position[Y_AXIS] || (blink & 1))
626
+        if (axis_homed[Y_AXIS] || (blink & 1))
627 627
           lcd.print(ftostr4sign(current_position[Y_AXIS]));
628 628
         else
629 629
           lcd_printPGM(PSTR(" ---"));
@@ -634,7 +634,7 @@ static void lcd_implementation_status_screen() {
634 634
 
635 635
     lcd.setCursor(LCD_WIDTH - 8, 1);
636 636
     lcd_printPGM(PSTR("Z "));
637
-    if (axis_known_position[Z_AXIS] || (blink & 1))
637
+    if (axis_homed[Z_AXIS] || (blink & 1))
638 638
       lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
639 639
     else
640 640
       lcd_printPGM(PSTR("---.--"));

Загрузка…
Отмена
Сохранить