Skip to content

Commit 3678347

Browse files
committed
Fix parser temperature rounding
1 parent 620ad65 commit 3678347

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Marlin/src/gcode/parser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ class GCodeParser {
367367
float f = value_float();
368368
switch (input_temp_units) {
369369
default:
370-
case TEMPUNIT_C: break;
370+
case TEMPUNIT_C: return f; break;
371371
case TEMPUNIT_K: f -= 273.15f;
372372
case TEMPUNIT_F: f = (f - 32) * 0.5555555556f;
373373
}
374-
return LROUND(f + 0.5f);
374+
return LROUND(f);
375375
}
376376

377377
static inline celsius_t value_celsius_diff() {
@@ -382,7 +382,7 @@ class GCodeParser {
382382
case TEMPUNIT_K: break;
383383
case TEMPUNIT_F: f *= 0.5555555556f;
384384
}
385-
return LROUND(f + 0.5f);
385+
return LROUND(f);
386386
}
387387

388388
#else // !TEMPERATURE_UNITS_SUPPORT

0 commit comments

Comments
 (0)