TM: Set the cal status bit when running M310 A directly

Running `M310 A` should set the TM calibration bit status if the
autotune procedure was successful.

Partially addresses #3891 and #3890, since running `M310 A F0` should
*still* count as valid calibration data and is not something that can be
replicated by using the LCD (which enforces self-test).
This commit is contained in:
Yuri D'Elia 2023-01-15 19:11:32 +01:00 committed by DRracer
parent 7adfd0c670
commit 128a23544d
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@
#include "stepper.h" #include "stepper.h"
#include "ultralcd.h" #include "ultralcd.h"
#include "menu.h" #include "menu.h"
#include "sound.h" #include "util.h"
#include "fancheck.h" #include "fancheck.h"
#include "messages.h" #include "messages.h"
#include "language.h" #include "language.h"
@ -2946,6 +2946,7 @@ void temp_model_autotune(int16_t temp, bool selftest)
memcpy(temp_model::data.R, orig_R, sizeof(temp_model::data.R)); memcpy(temp_model::data.R, orig_R, sizeof(temp_model::data.R));
temp_model_set_enabled(orig_enabled); temp_model_set_enabled(orig_enabled);
} else { } else {
calibration_status_set(CALIBRATION_STATUS_TEMP_MODEL);
lcd_setstatuspgm(MSG_WELCOME); lcd_setstatuspgm(MSG_WELCOME);
temp_model_cal::set_fan_speed(0); temp_model_cal::set_fan_speed(0);
temp_model_set_enabled(orig_enabled); temp_model_set_enabled(orig_enabled);

View File

@ -1064,7 +1064,6 @@ void lcd_commands()
lcd_commands_step = 0; lcd_commands_step = 0;
lcd_commands_type = LcdCommands::Idle; lcd_commands_type = LcdCommands::Idle;
bool res = temp_model_autotune_result(); bool res = temp_model_autotune_result();
if (res) calibration_status_set(CALIBRATION_STATUS_TEMP_MODEL);
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) {
// resume the wizard // resume the wizard
lcd_wizard(res ? WizState::Restore : WizState::Failed); lcd_wizard(res ? WizState::Restore : WizState::Failed);