Browse Source

Enable the model last, if set

We need all the values to be set before we can attempt to enable the
model.
Yuri D'Elia 2 years ago
parent
commit
92bc7554b6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Firmware/Marlin_main.cpp

+ 4 - 2
Firmware/Marlin_main.cpp

@@ -7808,12 +7808,14 @@ Sigma_Exit:
             break;
         }
 
-        // update all set parameters
-        if(S >= 0) temp_model_set_enabled(S);
+        // update all parameters
         if(B >= 0) temp_model_set_warn_beep(B);
         if(!isnan(C) || !isnan(P) || !isnan(T) || !isnan(W) || !isnan(E)) temp_model_set_params(C, P, T, W, E);
         if(I >= 0 && !isnan(R)) temp_model_set_resistance(I, R);
 
+        // enable the model last, if requested
+        if(S >= 0) temp_model_set_enabled(S);
+
         // run autotune
         if(A >= 0) temp_model_autotune(A);
     }