浏览代码

Apply FIXFLOAT macro

Scott Lahteine 8 年前
父节点
当前提交
4487d22d56
共有 4 个文件被更改,包括 7 次插入6 次删除
  1. 4
    4
      Marlin/Marlin_main.cpp
  2. 1
    0
      Marlin/macros.h
  3. 1
    1
      Marlin/ultralcd_impl_DOGM.h
  4. 1
    1
      Marlin/ultralcd_impl_HD44780.h

+ 4
- 4
Marlin/Marlin_main.cpp 查看文件

@@ -2287,7 +2287,7 @@ static void clean_up_after_endstop_or_probe_move() {
2287 2287
       SERIAL_PROTOCOLPGM(" Y: ");
2288 2288
       SERIAL_PROTOCOL_F(y, 3);
2289 2289
       SERIAL_PROTOCOLPGM(" Z: ");
2290
-      SERIAL_PROTOCOL_F(measured_z - -zprobe_zoffset + 0.0001, 3);
2290
+      SERIAL_PROTOCOL_F(FIXFLOAT(measured_z - -zprobe_zoffset), 3);
2291 2291
       SERIAL_EOL;
2292 2292
     }
2293 2293
 
@@ -4499,11 +4499,11 @@ inline void gcode_G28() {
4499 4499
     float measured_z = probe_pt(X_probe_location, Y_probe_location, stow, 1);
4500 4500
 
4501 4501
     SERIAL_PROTOCOLPGM("Bed X: ");
4502
-    SERIAL_PROTOCOL(X_probe_location + 0.0001);
4502
+    SERIAL_PROTOCOL(FIXFLOAT(X_probe_location));
4503 4503
     SERIAL_PROTOCOLPGM(" Y: ");
4504
-    SERIAL_PROTOCOL(Y_probe_location + 0.0001);
4504
+    SERIAL_PROTOCOL(FIXFLOAT(Y_probe_location));
4505 4505
     SERIAL_PROTOCOLPGM(" Z: ");
4506
-    SERIAL_PROTOCOLLN(measured_z - -zprobe_zoffset + 0.0001);
4506
+    SERIAL_PROTOCOLLN(FIXFLOAT(measured_z - -zprobe_zoffset));
4507 4507
 
4508 4508
     clean_up_after_endstop_or_probe_move();
4509 4509
 

+ 1
- 0
Marlin/macros.h 查看文件

@@ -138,5 +138,6 @@
138 138
 #define NEAR(x,y) NEAR_ZERO((x)-(y))
139 139
 
140 140
 #define RECIPROCAL(x) (NEAR_ZERO(x) ? 0.0 : 1.0 / (x))
141
+#define FIXFLOAT(f) (f + 0.00001)
141 142
 
142 143
 #endif //__MACROS_H

+ 1
- 1
Marlin/ultralcd_impl_DOGM.h 查看文件

@@ -543,7 +543,7 @@ static void lcd_implementation_status_screen() {
543 543
   if (page.page == 0) {
544 544
     strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
545 545
     strcpy(ystring, ftostr4sign(current_position[Y_AXIS]));
546
-    strcpy(zstring, ftostr52sp(current_position[Z_AXIS] + 0.00001));
546
+    strcpy(zstring, ftostr52sp(FIXFLOAT(current_position[Z_AXIS])));
547 547
     #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
548 548
       strcpy(wstring, ftostr12ns(filament_width_meas));
549 549
       strcpy(mstring, itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h 查看文件

@@ -729,7 +729,7 @@ static void lcd_implementation_status_screen() {
729 729
 
730 730
     lcd.setCursor(LCD_WIDTH - 8, 1);
731 731
     _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
732
-    lcd.print(ftostr52sp(current_position[Z_AXIS] + 0.00001));
732
+    lcd.print(ftostr52sp(FIXFLOAT(current_position[Z_AXIS])));
733 733
 
734 734
   #endif // LCD_HEIGHT > 2
735 735
 

正在加载...
取消
保存