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 // Change EEPROM version if the structure changes
#define EEPROM_VERSION "V61" #define EEPROM_VERSION "V62"
#define EEPROM_OFFSET 100 #define EEPROM_OFFSET 100
// Check the integrity of data offsets. // 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 #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
float x2_endstop_adj, // M666 X float x2_endstop_adj, // M666 X
y2_endstop_adj, // M666 Y y2_endstop_adj, // M666 Y
z2_endstop_adj; // M666 Z z2_endstop_adj, // M666 Z (S2)
#if ENABLED(Z_TRIPLE_ENDSTOPS) z3_endstop_adj; // M666 Z (S3)
float z3_endstop_adj; // M666 Z
#endif
#endif #endif
// //
@ -939,7 +937,7 @@ void MarlinSettings::postprocess() {
// SINGLENOZZLE // SINGLENOZZLE
// //
#if ENABLED(SINGLENOZZLE) #if EXTRUDERS > 1
_FIELD_TEST(toolchange_settings); _FIELD_TEST(toolchange_settings);
EEPROM_WRITE(toolchange_settings); EEPROM_WRITE(toolchange_settings);
#endif #endif
@ -1567,7 +1565,7 @@ void MarlinSettings::postprocess() {
// //
// SINGLENOZZLE toolchange values // SINGLENOZZLE toolchange values
// //
#if ENABLED(SINGLENOZZLE) #if EXTRUDERS > 1
_FIELD_TEST(toolchange_settings); _FIELD_TEST(toolchange_settings);
EEPROM_READ(toolchange_settings); EEPROM_READ(toolchange_settings);
#endif #endif
@ -1831,9 +1829,6 @@ void MarlinSettings::reset(PORTARG_SOLO) {
#endif #endif
#if EXTRUDERS > 1 #if EXTRUDERS > 1
toolchange_settings.z_raise = TOOLCHANGE_ZRAISE;
#endif
#if ENABLED(SINGLENOZZLE) #if ENABLED(SINGLENOZZLE)
toolchange_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH; toolchange_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH;
toolchange_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED; toolchange_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED;
@ -1842,6 +1837,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
toolchange_settings.change_point = SINGLENOZZLE_TOOLCHANGE_XY; toolchange_settings.change_point = SINGLENOZZLE_TOOLCHANGE_XY;
#endif #endif
#endif #endif
toolchange_settings.z_raise = TOOLCHANGE_ZRAISE;
#endif
// //
// Global Leveling // Global Leveling

View File

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