Bläddra i källkod

Apply FIXFLOAT macro

Scott Lahteine 8 år sedan
förälder
incheckning
4487d22d56
4 ändrade filer med 7 tillägg och 6 borttagningar
  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 Visa fil

2287
       SERIAL_PROTOCOLPGM(" Y: ");
2287
       SERIAL_PROTOCOLPGM(" Y: ");
2288
       SERIAL_PROTOCOL_F(y, 3);
2288
       SERIAL_PROTOCOL_F(y, 3);
2289
       SERIAL_PROTOCOLPGM(" Z: ");
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
       SERIAL_EOL;
2291
       SERIAL_EOL;
2292
     }
2292
     }
2293
 
2293
 
4499
     float measured_z = probe_pt(X_probe_location, Y_probe_location, stow, 1);
4499
     float measured_z = probe_pt(X_probe_location, Y_probe_location, stow, 1);
4500
 
4500
 
4501
     SERIAL_PROTOCOLPGM("Bed X: ");
4501
     SERIAL_PROTOCOLPGM("Bed X: ");
4502
-    SERIAL_PROTOCOL(X_probe_location + 0.0001);
4502
+    SERIAL_PROTOCOL(FIXFLOAT(X_probe_location));
4503
     SERIAL_PROTOCOLPGM(" Y: ");
4503
     SERIAL_PROTOCOLPGM(" Y: ");
4504
-    SERIAL_PROTOCOL(Y_probe_location + 0.0001);
4504
+    SERIAL_PROTOCOL(FIXFLOAT(Y_probe_location));
4505
     SERIAL_PROTOCOLPGM(" Z: ");
4505
     SERIAL_PROTOCOLPGM(" Z: ");
4506
-    SERIAL_PROTOCOLLN(measured_z - -zprobe_zoffset + 0.0001);
4506
+    SERIAL_PROTOCOLLN(FIXFLOAT(measured_z - -zprobe_zoffset));
4507
 
4507
 
4508
     clean_up_after_endstop_or_probe_move();
4508
     clean_up_after_endstop_or_probe_move();
4509
 
4509
 

+ 1
- 0
Marlin/macros.h Visa fil

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

+ 1
- 1
Marlin/ultralcd_impl_DOGM.h Visa fil

543
   if (page.page == 0) {
543
   if (page.page == 0) {
544
     strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
544
     strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
545
     strcpy(ystring, ftostr4sign(current_position[Y_AXIS]));
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
     #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
547
     #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
548
       strcpy(wstring, ftostr12ns(filament_width_meas));
548
       strcpy(wstring, ftostr12ns(filament_width_meas));
549
       strcpy(mstring, itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
549
       strcpy(mstring, itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h Visa fil

729
 
729
 
730
     lcd.setCursor(LCD_WIDTH - 8, 1);
730
     lcd.setCursor(LCD_WIDTH - 8, 1);
731
     _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
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
   #endif // LCD_HEIGHT > 2
734
   #endif // LCD_HEIGHT > 2
735
 
735
 

Laddar…
Avbryt
Spara