From 50fa87f1cfad92ff88f7c14ecaa39e1c2b33639f Mon Sep 17 00:00:00 2001 From: studiodyne <42887851+studiodyne@users.noreply.github.com> Date: Fri, 17 Apr 2020 18:19:31 +0200 Subject: [PATCH] Proportional Autotemp followup (#17585) Co-authored-by: Scott Lahteine --- Marlin/src/module/planner.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index e053676574..f55ef37bc4 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2991,13 +2991,14 @@ void Planner::set_max_jerk(const AxisEnum axis, float targetValue) { const int16_t target = thermalManager.degTargetHotend(active_extruder); autotemp_min = target + AUTOTEMP_MIN_P; autotemp_max = target + AUTOTEMP_MAX_P; - autotemp_factor = AUTOTEMP_FACTOR_P; #endif if (parser.seenval('S')) autotemp_min = parser.value_celsius(); if (parser.seenval('B')) autotemp_max = parser.value_celsius(); - if (parser.seenval('F')) autotemp_factor = parser.value_float(); - if (!autotemp_factor) autotemp_enabled = false; // F0 will disable autotemp - } + // When AUTOTEMP_PROPORTIONAL is enabled, F0 disables autotemp. + // Normally, leaving off F also disables autotemp. + autotemp_factor = parser.seen('F') ? parser.value_float() : TERN(AUTOTEMP_PROPORTIONAL, AUTOTEMP_FACTOR_P, 0); + autotemp_enabled = autotemp_factor != 0; + } #endif