From 15dfbabc9cbfde0551571b550e56f5d2d5271dd4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 3 Oct 2023 14:52:04 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Temp=20report=20precision=20opti?= =?UTF-8?q?on=20(#26253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/temperature.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b2e2915d17..2f8761ec39 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -4205,12 +4205,14 @@ void Temperature::isr() { case H_REDUNDANT: k = 'R'; break; #endif } - #define SFP _MIN(SERIAL_FLOAT_PRECISION, 2) + #ifndef HEATER_STATE_FLOAT_PRECISION + #define HEATER_STATE_FLOAT_PRECISION _MIN(SERIAL_FLOAT_PRECISION, 2) + #endif SString<50> s(' ', k); if (TERN0(HAS_MULTI_HOTEND, e >= 0)) s += char('0' + e); - s += ':'; s += p_float_t(c, SFP); - if (show_t) { s += F(" /"); s += p_float_t(t, SFP); } + s += ':'; s += p_float_t(c, HEATER_STATE_FLOAT_PRECISION); + if (show_t) { s += F(" /"); s += p_float_t(t, HEATER_STATE_FLOAT_PRECISION); } #if ENABLED(SHOW_TEMP_ADC_VALUES) // Temperature MAX SPI boards do not have an OVERSAMPLENR defined s.append(F(" ("), TERN(HAS_MAXTC_LIBRARIES, k == 'T', false) ? r : r * RECIPROCAL(OVERSAMPLENR), ')');