Skip to content

Commit

Permalink
🔧 Heater State Precision (if not <= 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 9, 2023
1 parent 11f98ad commit 9379daa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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), ')');
Expand Down

0 comments on commit 9379daa

Please sign in to comment.