From 5dad7e0d035ec82d2eeb38c79101cba93f35c958 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sun, 31 Jul 2022 03:05:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Use=20=5FMIN/=5FMAX=20macros=20f?= =?UTF-8?q?or=20native=20compatibility=20(#24570)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/temperature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 9374971741..56eceea39d 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1418,7 +1418,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { // At startup, initialize modeled temperatures if (isnan(hotend.modeled_block_temp)) { - hotend.modeled_ambient_temp = min(30.0f, hotend.celsius); // Cap initial value at reasonable max room temperature of 30C + hotend.modeled_ambient_temp = _MIN(30.0f, hotend.celsius); // Cap initial value at reasonable max room temperature of 30C hotend.modeled_block_temp = hotend.modeled_sensor_temp = hotend.celsius; } @@ -1464,7 +1464,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { // Only correct ambient when close to steady state (output power is not clipped or asymptotic temperature is reached) if (WITHIN(hotend.soft_pwm_amount, 1, 126) || fabs(blocktempdelta + delta_to_apply) < (MPC_STEADYSTATE * MPC_dT)) - hotend.modeled_ambient_temp += delta_to_apply > 0.f ? max(delta_to_apply, MPC_MIN_AMBIENT_CHANGE * MPC_dT) : min(delta_to_apply, -MPC_MIN_AMBIENT_CHANGE * MPC_dT); + hotend.modeled_ambient_temp += delta_to_apply > 0.f ? _MAX(delta_to_apply, MPC_MIN_AMBIENT_CHANGE * MPC_dT) : _MIN(delta_to_apply, -MPC_MIN_AMBIENT_CHANGE * MPC_dT); float power = 0.0; if (hotend.target != 0 && TERN1(HEATER_IDLE_HANDLER, !heater_idle[ee].timed_out)) {