In addition to the firmware version number, store the "PRUSA3D"
magic at the beginning of the EEPROM, so at the upgrade the firmware would know, if the previous firmware was a Prusa3D firmware.
This commit is contained in:
parent
d825c5ffac
commit
3c21438392
2 changed files with 21 additions and 1 deletions
|
@ -7,7 +7,8 @@
|
||||||
// Firmware version
|
// Firmware version
|
||||||
#define FW_version "3.0.5"
|
#define FW_version "3.0.5"
|
||||||
|
|
||||||
|
#define FW_PRUSA3D_MAGIC "PRUSA3DFW"
|
||||||
|
#define FW_PRUSA3D_MAGIC_LEN 10
|
||||||
|
|
||||||
// The total size of the EEPROM is
|
// The total size of the EEPROM is
|
||||||
// 4096 for the Atmega2560
|
// 4096 for the Atmega2560
|
||||||
|
@ -30,6 +31,16 @@
|
||||||
// The offsets are saved as 16bit signed int, scaled to tenths of microns.
|
// The offsets are saved as 16bit signed int, scaled to tenths of microns.
|
||||||
#define EEPROM_BED_CALIBRATION_Z_JITTER (EEPROM_BED_CALIBRATION_VEC_Y-2*8)
|
#define EEPROM_BED_CALIBRATION_Z_JITTER (EEPROM_BED_CALIBRATION_VEC_Y-2*8)
|
||||||
|
|
||||||
|
|
||||||
|
// Currently running firmware, each digit stored as uint16_t.
|
||||||
|
// The flavor differentiates a dev, alpha, beta, release candidate or a release version.
|
||||||
|
#define EEPROM_FIRMWARE_VERSION_FLAVOR (FW_PRUSA3D_MAGIC_LEN+6)
|
||||||
|
#define EEPROM_FIRMWARE_VERSION_REVISION (FW_PRUSA3D_MAGIC_LEN+4)
|
||||||
|
#define EEPROM_FIRMWARE_VERSION_MINOR (FW_PRUSA3D_MAGIC_LEN+2)
|
||||||
|
#define EEPROM_FIRMWARE_VERSION_MAJOR FW_PRUSA3D_MAGIC_LEN
|
||||||
|
// Magic string, indicating that the current or the previous firmware running was the Prusa3D firmware.
|
||||||
|
#define EEPROM_FIRMWARE_PRUSA_MAGIC
|
||||||
|
|
||||||
// This configuration file contains the basic settings.
|
// This configuration file contains the basic settings.
|
||||||
// Advanced settings can be found in Configuration_adv.h
|
// Advanced settings can be found in Configuration_adv.h
|
||||||
// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
|
// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
|
||||||
|
|
|
@ -12,6 +12,13 @@ const char* FW_VERSION_STR_P()
|
||||||
return FW_VERSION_STR;
|
return FW_VERSION_STR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char FW_PRUSA3D_MAGIC_STR[] PROGMEM = FW_PRUSA3D_MAGIC;
|
||||||
|
|
||||||
|
const char* FW_PRUSA3D_MAGIC_STR_P()
|
||||||
|
{
|
||||||
|
return FW_PRUSA3D_MAGIC_STR;
|
||||||
|
}
|
||||||
|
|
||||||
const char STR_REVISION_DEV [] PROGMEM = "dev";
|
const char STR_REVISION_DEV [] PROGMEM = "dev";
|
||||||
const char STR_REVISION_ALPHA[] PROGMEM = "alpha";
|
const char STR_REVISION_ALPHA[] PROGMEM = "alpha";
|
||||||
const char STR_REVISION_BETA [] PROGMEM = "beta";
|
const char STR_REVISION_BETA [] PROGMEM = "beta";
|
||||||
|
@ -268,6 +275,8 @@ bool show_upgrade_dialog_if_version_newer(const char *version_string)
|
||||||
|
|
||||||
void update_current_firmware_version_to_eeprom()
|
void update_current_firmware_version_to_eeprom()
|
||||||
{
|
{
|
||||||
|
for (int8_t i = 0; i < FW_PRUSA3D_MAGIC_LEN; ++ i)
|
||||||
|
eeprom_update_byte((uint8_t*)(EEPROM_FIRMWARE_PRUSA_MAGIC+i), pgm_read_byte(FW_PRUSA3D_MAGIC_STR+i));
|
||||||
uint16_t ver_current[4];
|
uint16_t ver_current[4];
|
||||||
if (parse_version_P(FW_VERSION_STR, ver_current)) {
|
if (parse_version_P(FW_VERSION_STR, ver_current)) {
|
||||||
eeprom_update_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR, ver_current[0]);
|
eeprom_update_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR, ver_current[0]);
|
||||||
|
|
Loading…
Reference in a new issue