From 4487d22d56d32ab4c543345b55b5f61f7cb06403 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 31 Mar 2017 08:17:10 -0500 Subject: [PATCH] Apply FIXFLOAT macro --- Marlin/Marlin_main.cpp | 8 ++++---- Marlin/macros.h | 1 + Marlin/ultralcd_impl_DOGM.h | 2 +- Marlin/ultralcd_impl_HD44780.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e3f42daf0e..2ac53db976 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2287,7 +2287,7 @@ static void clean_up_after_endstop_or_probe_move() { SERIAL_PROTOCOLPGM(" Y: "); SERIAL_PROTOCOL_F(y, 3); SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL_F(measured_z - -zprobe_zoffset + 0.0001, 3); + SERIAL_PROTOCOL_F(FIXFLOAT(measured_z - -zprobe_zoffset), 3); SERIAL_EOL; } @@ -4499,11 +4499,11 @@ inline void gcode_G28() { float measured_z = probe_pt(X_probe_location, Y_probe_location, stow, 1); SERIAL_PROTOCOLPGM("Bed X: "); - SERIAL_PROTOCOL(X_probe_location + 0.0001); + SERIAL_PROTOCOL(FIXFLOAT(X_probe_location)); SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL(Y_probe_location + 0.0001); + SERIAL_PROTOCOL(FIXFLOAT(Y_probe_location)); SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOLLN(measured_z - -zprobe_zoffset + 0.0001); + SERIAL_PROTOCOLLN(FIXFLOAT(measured_z - -zprobe_zoffset)); clean_up_after_endstop_or_probe_move(); diff --git a/Marlin/macros.h b/Marlin/macros.h index 45317cc11c..18c5364a16 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -138,5 +138,6 @@ #define NEAR(x,y) NEAR_ZERO((x)-(y)) #define RECIPROCAL(x) (NEAR_ZERO(x) ? 0.0 : 1.0 / (x)) +#define FIXFLOAT(f) (f + 0.00001) #endif //__MACROS_H diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 25ee7b9c59..cb06db95a2 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -543,7 +543,7 @@ static void lcd_implementation_status_screen() { if (page.page == 0) { strcpy(xstring, ftostr4sign(current_position[X_AXIS])); strcpy(ystring, ftostr4sign(current_position[Y_AXIS])); - strcpy(zstring, ftostr52sp(current_position[Z_AXIS] + 0.00001)); + strcpy(zstring, ftostr52sp(FIXFLOAT(current_position[Z_AXIS]))); #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) strcpy(wstring, ftostr12ns(filament_width_meas)); strcpy(mstring, itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM])); diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index d81e342442..6672e4b08c 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -729,7 +729,7 @@ static void lcd_implementation_status_screen() { lcd.setCursor(LCD_WIDTH - 8, 1); _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink); - lcd.print(ftostr52sp(current_position[Z_AXIS] + 0.00001)); + lcd.print(ftostr52sp(FIXFLOAT(current_position[Z_AXIS]))); #endif // LCD_HEIGHT > 2