Read version data from progmem in eeprom_fw_version_older_than
This commit is contained in:
parent
a8057e0d36
commit
05f37edad5
@ -1548,7 +1548,8 @@ void setup()
|
|||||||
// calibrated printer upgraded from FW<3.12
|
// calibrated printer upgraded from FW<3.12
|
||||||
calibration_status |= (CALIBRATION_STATUS_SELFTEST | CALIBRATION_STATUS_XYZ | CALIBRATION_STATUS_Z | CALIBRATION_STATUS_LIVE_ADJUST);
|
calibration_status |= (CALIBRATION_STATUS_SELFTEST | CALIBRATION_STATUS_XYZ | CALIBRATION_STATUS_Z | CALIBRATION_STATUS_LIVE_ADJUST);
|
||||||
|
|
||||||
if (eeprom_fw_version_older_than({3, 2, 0, 4})) {
|
static const uint16_t v3_2_0_4[] PROGMEM = {3, 2, 0, 4};
|
||||||
|
if (eeprom_fw_version_older_than_p(v3_2_0_4)) {
|
||||||
// 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;
|
||||||
|
@ -181,19 +181,19 @@ inline int8_t is_provided_version_newer(const char *version_string)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool eeprom_fw_version_older_than(const uint16_t (&ver_req)[4])
|
bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4])
|
||||||
{
|
{
|
||||||
uint16_t ver_eeprom[4];
|
uint16_t ver_eeprom[4];
|
||||||
|
|
||||||
ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR);
|
ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR);
|
||||||
ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR);
|
ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR);
|
||||||
ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION);
|
ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION);
|
||||||
ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR);
|
ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR);
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 4; ++i) {
|
for (uint8_t i = 0; i < 4; ++i) {
|
||||||
if (ver_req[i] > ver_eeprom[i])
|
uint16_t v = pgm_read_word(&ver_req[i]);
|
||||||
|
if (v > ver_eeprom[i])
|
||||||
return true;
|
return true;
|
||||||
else if (ver_req[i] < ver_eeprom[i])
|
else if (v < ver_eeprom[i])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ enum FirmwareRevisionFlavorType : uint16_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool show_upgrade_dialog_if_version_newer(const char *version_string);
|
bool show_upgrade_dialog_if_version_newer(const char *version_string);
|
||||||
bool eeprom_fw_version_older_than(const uint16_t (&req_ver)[4]);
|
bool eeprom_fw_version_older_than_p(const uint16_t (&req_ver)[4]);
|
||||||
void update_current_firmware_version_to_eeprom();
|
void update_current_firmware_version_to_eeprom();
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user