Browse Source

🩹 Use _MIN/_MAX macros for native compatibility (#24570)

tombrazier 1 year ago
parent
commit
aba35ec1af
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/module/temperature.cpp

+ 2
- 2
Marlin/src/module/temperature.cpp View File

@@ -1418,7 +1418,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
1418 1418
 
1419 1419
       // At startup, initialize modeled temperatures
1420 1420
       if (isnan(hotend.modeled_block_temp)) {
1421
-        hotend.modeled_ambient_temp = min(30.0f, hotend.celsius);   // Cap initial value at reasonable max room temperature of 30C
1421
+        hotend.modeled_ambient_temp = _MIN(30.0f, hotend.celsius);   // Cap initial value at reasonable max room temperature of 30C
1422 1422
         hotend.modeled_block_temp = hotend.modeled_sensor_temp = hotend.celsius;
1423 1423
       }
1424 1424
 
@@ -1464,7 +1464,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
1464 1464
 
1465 1465
       // Only correct ambient when close to steady state (output power is not clipped or asymptotic temperature is reached)
1466 1466
       if (WITHIN(hotend.soft_pwm_amount, 1, 126) || fabs(blocktempdelta + delta_to_apply) < (MPC_STEADYSTATE * MPC_dT))
1467
-        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);
1467
+        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);
1468 1468
 
1469 1469
       float power = 0.0;
1470 1470
       if (hotend.target != 0 && TERN1(HEATER_IDLE_HANDLER, !heater_idle[ee].timed_out)) {

Loading…
Cancel
Save