Pārlūkot izejas kodu

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.
Yuri D'Elia 1 gadu atpakaļ
vecāks
revīzija
66071c0b5b
3 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. 6 1
      Firmware/Marlin_main.cpp
  2. 1 1
      Firmware/util.cpp
  3. 1 0
      Firmware/util.h

+ 6 - 1
Firmware/Marlin_main.cpp

@@ -1534,11 +1534,16 @@ void setup()
               // 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
               calibration_status &= ~CALIBRATION_STATUS_SELFTEST;
-              run_wizard = true;
           }
       }
       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();
 
   if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) {

+ 1 - 1
Firmware/util.cpp

@@ -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.
 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_MINOR,
     FW_REVISION,

+ 1 - 0
Firmware/util.h

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