Block LCD during temperature model autocalibration

This commit is contained in:
Yuri D'Elia 2022-07-18 17:30:34 +02:00
parent 79161f829e
commit 41abe1689c
2 changed files with 14 additions and 2 deletions

View File

@ -34,6 +34,9 @@ extern uint8_t menu_depth;
enum ESeriousErrors {
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 !=

View File

@ -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