wizard: Resume the wizard for missing calibrations during upgrades

Instead of checking for explicit versions, resume the wizard if some
(new) wizard is missing.

This handles both the old SELFTEST check, the new thermal model
and any future check in the same fashion.
This commit is contained in:
Yuri D'Elia 2022-12-29 16:06:02 +01:00 committed by DRracer
parent 05f37edad5
commit fbfacd76a4
3 changed files with 8 additions and 2 deletions

View File

@ -1553,11 +1553,16 @@ void setup()
// printer upgraded from FW<3.2.0.4 and requires re-running selftest // printer upgraded from FW<3.2.0.4 and requires re-running selftest
lcd_show_fullscreen_message_and_wait_P(_i("Selftest will be run to calibrate accurate sensorless rehoming."));////MSG_FORCE_SELFTEST c=20 r=8 lcd_show_fullscreen_message_and_wait_P(_i("Selftest will be run to calibrate accurate sensorless rehoming."));////MSG_FORCE_SELFTEST c=20 r=8
calibration_status &= ~CALIBRATION_STATUS_SELFTEST; calibration_status &= ~CALIBRATION_STATUS_SELFTEST;
run_wizard = true;
} }
} }
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status);
} }
if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) {
if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) {
// we just did a FW upgrade and some (new) wizard step is missing: resume the wizard
run_wizard = true;
}
}
update_current_firmware_version_to_eeprom(); update_current_firmware_version_to_eeprom();
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) {

View File

@ -10,7 +10,7 @@
// Allocate the version string in the program memory. Otherwise the string lands either on the stack or in the global RAM. // Allocate the version string in the program memory. Otherwise the string lands either on the stack or in the global RAM.
static const char FW_VERSION_STR[] PROGMEM = FW_VERSION; static const char FW_VERSION_STR[] PROGMEM = FW_VERSION;
static const uint16_t FW_VERSION_NR[4] PROGMEM = { const uint16_t FW_VERSION_NR[4] PROGMEM = {
FW_MAJOR, FW_MAJOR,
FW_MINOR, FW_MINOR,
FW_REVISION, FW_REVISION,

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
extern const uint16_t FW_VERSION_NR[4];
extern const char* FW_VERSION_STR_P(); extern const char* FW_VERSION_STR_P();
// Definition of a firmware flavor numerical values. // Definition of a firmware flavor numerical values.