Correct EEPROM read/write disparities. (#12169)

This commit is contained in:
Roman Moravčík 2018-10-21 09:56:31 +02:00 committed by Scott Lahteine
parent 8d3a92fc4a
commit d801f85963
2 changed files with 20 additions and 21 deletions

View File

@ -37,7 +37,7 @@
*/
// Change EEPROM version if the structure changes
#define EEPROM_VERSION "V61"
#define EEPROM_VERSION "V62"
#define EEPROM_OFFSET 100
// Check the integrity of data offsets.
@ -194,10 +194,8 @@ typedef struct SettingsDataStruct {
#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
float x2_endstop_adj, // M666 X
y2_endstop_adj, // M666 Y
z2_endstop_adj; // M666 Z
#if ENABLED(Z_TRIPLE_ENDSTOPS)
float z3_endstop_adj; // M666 Z
#endif
z2_endstop_adj, // M666 Z (S2)
z3_endstop_adj; // M666 Z (S3)
#endif
//
@ -939,7 +937,7 @@ void MarlinSettings::postprocess() {
// SINGLENOZZLE
//
#if ENABLED(SINGLENOZZLE)
#if EXTRUDERS > 1
_FIELD_TEST(toolchange_settings);
EEPROM_WRITE(toolchange_settings);
#endif
@ -1567,7 +1565,7 @@ void MarlinSettings::postprocess() {
//
// SINGLENOZZLE toolchange values
//
#if ENABLED(SINGLENOZZLE)
#if EXTRUDERS > 1
_FIELD_TEST(toolchange_settings);
EEPROM_READ(toolchange_settings);
#endif
@ -1831,16 +1829,15 @@ void MarlinSettings::reset(PORTARG_SOLO) {
#endif
#if EXTRUDERS > 1
toolchange_settings.z_raise = TOOLCHANGE_ZRAISE;
#endif
#if ENABLED(SINGLENOZZLE)
toolchange_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH;
toolchange_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED;
toolchange_settings.retract_speed = SINGLENOZZLE_SWAP_RETRACT_SPEED;
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
toolchange_settings.change_point = SINGLENOZZLE_TOOLCHANGE_XY;
#if ENABLED(SINGLENOZZLE)
toolchange_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH;
toolchange_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED;
toolchange_settings.retract_speed = SINGLENOZZLE_SWAP_RETRACT_SPEED;
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
toolchange_settings.change_point = SINGLENOZZLE_TOOLCHANGE_XY;
#endif
#endif
toolchange_settings.z_raise = TOOLCHANGE_ZRAISE;
#endif
//

View File

@ -26,12 +26,14 @@
#if EXTRUDERS > 1
typedef struct {
float swap_length;
int16_t prime_speed, retract_speed;
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
struct { float x, y; } change_point;
#if ENABLED(SINGLENOZZLE)
float swap_length;
int16_t prime_speed, retract_speed;
#if ENABLED(SINGLENOZZLE_SWAP_PARK)
struct { float x, y; } change_point;
#endif
#endif
float z_raise = TOOLCHANGE_ZRAISE;
float z_raise;
} toolchange_settings_t;
extern toolchange_settings_t toolchange_settings;