Browse Source

Block LCD during temperature model autocalibration

Yuri D'Elia 1 year ago
parent
commit
41abe1689c
2 changed files with 14 additions and 2 deletions
  1. 5 2
      Firmware/menu.h
  2. 9 0
      Firmware/temperature.cpp

+ 5 - 2
Firmware/menu.h

@@ -32,8 +32,11 @@ extern uint8_t menu_depth;
 //! definition of reasons blocking the main menu
 //! Use them as bit mask, so that the code may set various errors at the same time
 enum ESeriousErrors {
-	MENU_BLOCK_NONE             = 0,
-	MENU_BLOCK_THERMAL_ERROR    = 0x01,
+	MENU_BLOCK_NONE                = 0,
+	MENU_BLOCK_THERMAL_ERROR       = 0x01,
+#ifdef TEMP_MODEL
+	MENU_BLOCK_TEMP_MODEL_AUTOTUNE = 0x02,
+#endif
 }; // and possibly others in the future.
 
 //! this is a flag for disabling entering the main menu and longpress. If this is set to anything !=

+ 9 - 0
Firmware/temperature.cpp

@@ -35,6 +35,7 @@
 #include "sound.h"
 #include "fancheck.h"
 #include "messages.h"
+#include "language.h"
 
 #include "SdFatUtil.h"
 
@@ -2810,7 +2811,11 @@ void temp_model_autotune(int16_t temp)
         return;
     }
 
+    // lockout the printer during calibration
     KEEPALIVE_STATE(IN_PROCESS);
+    menu_set_block(MENU_BLOCK_TEMP_MODEL_AUTOTUNE);
+    lcd_setstatuspgm(_i("Temp. model autotune"));
+    lcd_return_to_status();
 
     // disable the model checking during self-calibration
     bool was_enabled = temp_model::enabled;
@@ -2824,13 +2829,17 @@ void temp_model_autotune(int16_t temp)
 
     if(err) {
         SERIAL_ECHOLNPGM("TM: autotune failed");
+        lcd_setstatuspgm(_i("TM autotune failed"));
         if(temp_error_state.v)
             fanSpeedSoftPwm = 255;
     } else {
+        lcd_setstatuspgm(MSG_WELCOME);
         fanSpeedSoftPwm = 0;
         temp_model_set_enabled(was_enabled);
         temp_model_report_settings();
     }
+
+    menu_unset_block(MENU_BLOCK_TEMP_MODEL_AUTOTUNE);
 }
 
 #ifdef TEMP_MODEL_DEBUG