From c64a5a4b8fda56d3d057158440cccfe0e1fe5e51 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Tue, 5 Jan 2021 13:18:09 +0100 Subject: [PATCH] Temperature report followup (#20687) Co-authored-by: Scott Lahteine --- Marlin/src/module/temperature.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 3c10354d02..924d796bfc 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1404,8 +1404,7 @@ void Temperature::manage_heater() { SERIAL_ECHOPGM(" M305 "); else SERIAL_ECHO_START(); - SERIAL_CHAR('P'); - SERIAL_CHAR('0' + t_index); + SERIAL_CHAR('P', '0' + t_index); const user_thermistor_t &t = user_thermistor[t_index]; @@ -3001,15 +3000,19 @@ void Temperature::tick() { default: k = 'B'; break; #endif } - SERIAL_CHAR(' '); - SERIAL_CHAR(k); + SERIAL_CHAR(' ', k); #if HAS_MULTI_HOTEND if (e >= 0) SERIAL_CHAR('0' + e); #endif + #ifdef SERIAL_FLOAT_PRECISION + #define SFP _MIN(SERIAL_FLOAT_PRECISION, 2) + #else + #define SFP 2 + #endif SERIAL_CHAR(':'); - SERIAL_PRINT(c, _MIN(SERIAL_FLOAT_PRECISION, 2)); + SERIAL_PRINT(c, SFP); SERIAL_ECHOPGM(" /"); - SERIAL_PRINT(t, _MIN(SERIAL_FLOAT_PRECISION, 2)); + SERIAL_PRINT(t, SFP); #if ENABLED(SHOW_TEMP_ADC_VALUES) SERIAL_ECHOPAIR(" (", r * RECIPROCAL(OVERSAMPLENR)); SERIAL_CHAR(')');