Quellcode durchsuchen

Fix Z position on HD44780

Fix #9732
Scott Lahteine vor 7 Jahren
Ursprung
Commit
2c9775313a
2 geänderte Dateien mit 22 neuen und 30 gelöschten Zeilen
  1. 1
    1
      Marlin/src/lcd/ultralcd_impl_HD44780.h
  2. 21
    29
      Marlin/src/module/motion.h

+ 1
- 1
Marlin/src/lcd/ultralcd_impl_HD44780.h Datei anzeigen

@@ -837,7 +837,7 @@ static void lcd_implementation_status_screen() {
837 837
 
838 838
     lcd.setCursor(LCD_WIDTH - 8, 1);
839 839
     _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
840
-    lcd.print(ftostr52sp(FIXFLOAT(current_position[Z_AXIS])));
840
+    lcd.print(ftostr52sp(FIXFLOAT(LOGICAL_Z_POSITION(current_position[Z_AXIS]))));
841 841
 
842 842
     #if HAS_LEVELING && !TEMP_SENSOR_BED
843 843
       lcd.write(planner.leveling_active || blink ? '_' : ' ');

+ 21
- 29
Marlin/src/module/motion.h Datei anzeigen

@@ -195,7 +195,9 @@ void homeaxis(const AxisEnum axis);
195 195
 // Macros
196 196
 //
197 197
 
198
-// Workspace offsets
198
+/**
199
+ * Workspace offsets
200
+ */
199 201
 #if HAS_WORKSPACE_OFFSET
200 202
   #if HAS_HOME_OFFSET
201 203
     extern float home_offset[XYZ];
@@ -203,36 +205,26 @@ void homeaxis(const AxisEnum axis);
203 205
   #if HAS_POSITION_SHIFT
204 206
     extern float position_shift[XYZ];
205 207
   #endif
206
-#endif
207
-
208
-#if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
209
-  extern float workspace_offset[XYZ];
210
-  #define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS]
211
-#elif HAS_HOME_OFFSET
212
-  #define WORKSPACE_OFFSET(AXIS) home_offset[AXIS]
213
-#elif HAS_POSITION_SHIFT
214
-  #define WORKSPACE_OFFSET(AXIS) position_shift[AXIS]
215
-#else
216
-  #define WORKSPACE_OFFSET(AXIS) 0
217
-#endif
218
-
219
-#define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS))
220
-#define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS))
221
-
222
-#if HAS_POSITION_SHIFT || DISABLED(DELTA)
223
-  #define LOGICAL_X_POSITION(POS)   NATIVE_TO_LOGICAL(POS, X_AXIS)
224
-  #define LOGICAL_Y_POSITION(POS)   NATIVE_TO_LOGICAL(POS, Y_AXIS)
225
-  #define RAW_X_POSITION(POS)       LOGICAL_TO_NATIVE(POS, X_AXIS)
226
-  #define RAW_Y_POSITION(POS)       LOGICAL_TO_NATIVE(POS, Y_AXIS)
208
+  #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
209
+    extern float workspace_offset[XYZ];
210
+    #define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS]
211
+  #elif HAS_HOME_OFFSET
212
+    #define WORKSPACE_OFFSET(AXIS) home_offset[AXIS]
213
+  #elif HAS_POSITION_SHIFT
214
+    #define WORKSPACE_OFFSET(AXIS) position_shift[AXIS]
215
+  #endif
216
+  #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS))
217
+  #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS))
227 218
 #else
228
-  #define LOGICAL_X_POSITION(POS)   (POS)
229
-  #define LOGICAL_Y_POSITION(POS)   (POS)
230
-  #define RAW_X_POSITION(POS)       (POS)
231
-  #define RAW_Y_POSITION(POS)       (POS)
219
+  #define NATIVE_TO_LOGICAL(POS, AXIS) (POS)
220
+  #define LOGICAL_TO_NATIVE(POS, AXIS) (POS)
232 221
 #endif
233
-
234
-#define LOGICAL_Z_POSITION(POS)     NATIVE_TO_LOGICAL(POS, Z_AXIS)
235
-#define RAW_Z_POSITION(POS)         LOGICAL_TO_NATIVE(POS, Z_AXIS)
222
+#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS)
223
+#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS)
224
+#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS)
225
+#define RAW_X_POSITION(POS)     LOGICAL_TO_NATIVE(POS, X_AXIS)
226
+#define RAW_Y_POSITION(POS)     LOGICAL_TO_NATIVE(POS, Y_AXIS)
227
+#define RAW_Z_POSITION(POS)     LOGICAL_TO_NATIVE(POS, Z_AXIS)
236 228
 
237 229
 /**
238 230
  * position_is_reachable family of functions

Laden…
Abbrechen
Speichern