EEPROM address conflict fix; forcing selftest can happen only in case that we have TMC2130 drivers

This commit is contained in:
PavelSindler 2018-04-18 14:11:42 +02:00
parent cf99808aef
commit 5791d9f0d8
3 changed files with 12 additions and 9 deletions

View file

@ -7,7 +7,7 @@
#define STR(x) STR_HELPER(x)
// Firmware version
#define FW_VERSION "3.2.0-RC1"
#define FW_VERSION "3.2.0-RC2"
#define FW_COMMIT_NR 461
// FW_VERSION_UNKNOWN means this is an unofficial build.
// The firmware should only be checked into github with this symbol.
@ -132,10 +132,6 @@
// Power loss errors (total)
#define EEPROM_POWER_COUNT_TOT (EEPROM_FERROR_COUNT_TOT - 2) // uint16
#define EEPROM_PRINTER_TYPE (EEPROM_POWER_COUNT_TOT - 2) // uint16
#define EEPROM_BOARD_TYPE (EEPROM_PRINTER_TYPE - 2) // uint16
////////////////////////////////////////
// TMC2130 Accurate sensorless homing
@ -174,6 +170,8 @@
#define EEPROM_TMC2130_Z_MRES (EEPROM_TMC2130_Y_MRES - 1) // uint8
#define EEPROM_TMC2130_E_MRES (EEPROM_TMC2130_Z_MRES - 1) // uint8
#define EEPROM_PRINTER_TYPE (EEPROM_TMC2130_E_MRES - 2) // uint16
#define EEPROM_BOARD_TYPE (EEPROM_PRINTER_TYPE - 2) // uint16
//TMC2130 configuration
#define EEPROM_TMC_AXIS_SIZE //axis configuration block size

View file

@ -1336,7 +1336,8 @@ void setup()
}
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 0) { //dont show calibration status messages if wizard is currently active
if (calibration_status() == CALIBRATION_STATUS_ASSEMBLED ||
calibration_status() == CALIBRATION_STATUS_UNKNOWN) {
calibration_status() == CALIBRATION_STATUS_UNKNOWN ||
calibration_status() == CALIBRATION_STATUS_XYZ_CALIBRATION) {
// Reset the babystepping values, so the printer will not move the Z axis up when the babystepping is enabled.
eeprom_update_word((uint16_t*)EEPROM_BABYSTEP_Z, 0);
// Show the message.
@ -1357,13 +1358,13 @@ void setup()
}
}
#ifndef DEBUG_DISABLE_FORCE_SELFTEST
if (force_selftest_if_fw_version() && calibration_status() < CALIBRATION_STATUS_ASSEMBLED ) {
#if !defined (DEBUG_DISABLE_FORCE_SELFTEST) && defined (TMC2130)
if (force_selftest_if_fw_version() && calibration_status() < CALIBRATION_STATUS_ASSEMBLED) {
lcd_show_fullscreen_message_and_wait_P(MSG_FORCE_SELFTEST);
update_current_firmware_version_to_eeprom();
lcd_selftest();
}
#endif //DEBUG_DISABLE_FORCE_SELFTEST
#endif //TMC2130 && !DEBUG_DISABLE_FORCE_SELFTEST
KEEPALIVE_STATE(IN_PROCESS);
#endif //DEBUG_DISABLE_STARTMSGS

View file

@ -260,6 +260,10 @@ bool force_selftest_if_fw_version()
else if (ver_with_calibration[i] < ver_eeprom[i])
break;
}
//force selftest also in case that version used before flashing new firmware was 3.2.0-RC1
if ((ver_eeprom[0] == 3) && (ver_eeprom[1] == 2) && (ver_eeprom[2] == 0) && (ver_eeprom[3] == 3)) force_selftest = true;
return force_selftest;
}