Fix Z value on HD44780 (#9770)
This commit is contained in:
parent
d55aaf95e8
commit
85162da0df
@ -244,7 +244,9 @@ extern volatile bool wait_for_heatup;
|
|||||||
|
|
||||||
extern float current_position[XYZE], destination[XYZE];
|
extern float current_position[XYZE], destination[XYZE];
|
||||||
|
|
||||||
// Workspace offsets
|
/**
|
||||||
|
* Workspace offsets
|
||||||
|
*/
|
||||||
#if HAS_WORKSPACE_OFFSET
|
#if HAS_WORKSPACE_OFFSET
|
||||||
#if HAS_HOME_OFFSET
|
#if HAS_HOME_OFFSET
|
||||||
extern float home_offset[XYZ];
|
extern float home_offset[XYZ];
|
||||||
@ -252,36 +254,26 @@ extern float current_position[XYZE], destination[XYZE];
|
|||||||
#if HAS_POSITION_SHIFT
|
#if HAS_POSITION_SHIFT
|
||||||
extern float position_shift[XYZ];
|
extern float position_shift[XYZ];
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
|
||||||
|
extern float workspace_offset[XYZ];
|
||||||
#if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
|
#define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS]
|
||||||
extern float workspace_offset[XYZ];
|
#elif HAS_HOME_OFFSET
|
||||||
#define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS]
|
#define WORKSPACE_OFFSET(AXIS) home_offset[AXIS]
|
||||||
#elif HAS_HOME_OFFSET
|
#elif HAS_POSITION_SHIFT
|
||||||
#define WORKSPACE_OFFSET(AXIS) home_offset[AXIS]
|
#define WORKSPACE_OFFSET(AXIS) position_shift[AXIS]
|
||||||
#elif HAS_POSITION_SHIFT
|
#endif
|
||||||
#define WORKSPACE_OFFSET(AXIS) position_shift[AXIS]
|
#define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS))
|
||||||
|
#define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS))
|
||||||
#else
|
#else
|
||||||
#define WORKSPACE_OFFSET(AXIS) 0
|
#define NATIVE_TO_LOGICAL(POS, AXIS) (POS)
|
||||||
|
#define LOGICAL_TO_NATIVE(POS, AXIS) (POS)
|
||||||
#endif
|
#endif
|
||||||
|
#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS)
|
||||||
#define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS))
|
#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS)
|
||||||
#define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS))
|
#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS)
|
||||||
|
#define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS)
|
||||||
#if HAS_POSITION_SHIFT || DISABLED(DELTA)
|
#define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS)
|
||||||
#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS)
|
#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS)
|
||||||
#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS)
|
|
||||||
#define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS)
|
|
||||||
#define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS)
|
|
||||||
#else
|
|
||||||
#define LOGICAL_X_POSITION(POS) (POS)
|
|
||||||
#define LOGICAL_Y_POSITION(POS) (POS)
|
|
||||||
#define RAW_X_POSITION(POS) (POS)
|
|
||||||
#define RAW_Y_POSITION(POS) (POS)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS)
|
|
||||||
#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS)
|
|
||||||
|
|
||||||
// Hotend Offsets
|
// Hotend Offsets
|
||||||
#if HOTENDS > 1
|
#if HOTENDS > 1
|
||||||
|
@ -832,7 +832,7 @@ static void lcd_implementation_status_screen() {
|
|||||||
|
|
||||||
lcd.setCursor(LCD_WIDTH - 8, 1);
|
lcd.setCursor(LCD_WIDTH - 8, 1);
|
||||||
_draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
|
_draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
|
||||||
lcd.print(ftostr52sp(FIXFLOAT(current_position[Z_AXIS])));
|
lcd.print(ftostr52sp(FIXFLOAT(LOGICAL_Y_POSITION(current_position[Z_AXIS]))));
|
||||||
|
|
||||||
#if HAS_LEVELING && !TEMP_SENSOR_BED
|
#if HAS_LEVELING && !TEMP_SENSOR_BED
|
||||||
lcd.write(planner.leveling_active || blink ? '_' : ' ');
|
lcd.write(planner.leveling_active || blink ? '_' : ' ');
|
||||||
|
Loading…
Reference in New Issue
Block a user