From 128a23544d1c83db886b1ba443669332e1a8f2bd Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 15 Jan 2023 19:11:32 +0100 Subject: [PATCH] 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). --- Firmware/temperature.cpp | 3 ++- Firmware/ultralcd.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 5cbbc6f8..6ddbe642 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -32,7 +32,7 @@ #include "stepper.h" #include "ultralcd.h" #include "menu.h" -#include "sound.h" +#include "util.h" #include "fancheck.h" #include "messages.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)); temp_model_set_enabled(orig_enabled); } else { + calibration_status_set(CALIBRATION_STATUS_TEMP_MODEL); lcd_setstatuspgm(MSG_WELCOME); temp_model_cal::set_fan_speed(0); temp_model_set_enabled(orig_enabled); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 06f0c519..de20edaf 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1064,7 +1064,6 @@ void lcd_commands() lcd_commands_step = 0; lcd_commands_type = LcdCommands::Idle; bool res = temp_model_autotune_result(); - if (res) calibration_status_set(CALIBRATION_STATUS_TEMP_MODEL); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed);