Browse Source

wizard: Allow partial resuming after reset

Update the eeprom FW version as soon as migration is complete, to avoid
resetting the CALIBRATION_V2 variable at each reset.

Do not implicitly reset the calibration steps for WizState::Run: do this
only for the menu action.
Yuri D'Elia 1 year ago
parent
commit
8fa0a22b8d
2 changed files with 3 additions and 5 deletions
  1. 2 4
      Firmware/Marlin_main.cpp
  2. 1 1
      Firmware/ultralcd.cpp

+ 2 - 4
Firmware/Marlin_main.cpp

@@ -1521,7 +1521,7 @@ void setup()
 	  Config_StoreSettings();
   }
 
-  // handle calibration status upgrade
+  // handle FW and calibration status upgrade
   bool run_wizard = false;
   if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) {
       CalibrationStatus calibration_status = 0;
@@ -1538,6 +1538,7 @@ void setup()
       }
       eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status);
   }
+  update_current_firmware_version_to_eeprom();
 
   if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) {
       // first time run of wizard or service prep
@@ -1571,9 +1572,6 @@ void setup()
   lcd_update_enable(true);
   lcd_clear();
   lcd_update(2);
-  // Store the currently running firmware into an eeprom,
-  // so the next time the firmware gets updated, it will know from which version it has been updated.
-  update_current_firmware_version_to_eeprom();
 
 #ifdef TMC2130
   tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0);

+ 1 - 1
Firmware/ultralcd.cpp

@@ -3827,6 +3827,7 @@ void lcd_wizard() {
 		result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Running Wizard will delete current calibration results and start from the beginning. Continue?"), false);////MSG_WIZARD_RERUN c=20 r=7
 	}
 	if (result) {
+		calibration_status_clear(CALIBRATION_WIZARD_STEPS);
 		lcd_wizard(WizState::Run);
 	} else {
 		lcd_return_to_status();
@@ -3984,7 +3985,6 @@ void lcd_wizard(WizState state)
 				if (wizard_event == LCD_LEFT_BUTTON_CHOICE) {
 					state = S::Restore;
 					eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
-					calibration_status_clear(CALIBRATION_WIZARD_STEPS);
 				} else {
 					// user interrupted
 					eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);