Move [xyz]_endstop_adj to Endstops class

This commit is contained in:
Scott Lahteine
2018-03-10 05:12:57 -06:00
parent 83c83e3127
commit e8fc0e9a57
5 changed files with 82 additions and 68 deletions

View File

@@ -546,19 +546,19 @@ void MarlinSettings::postprocess() {
// Write dual endstops in X, Y, Z order. Unused = 0.0
dummy = 0.0f;
#if ENABLED(X_DUAL_ENDSTOPS)
EEPROM_WRITE(x_endstop_adj); // 1 float
EEPROM_WRITE(endstops.x_endstop_adj); // 1 float
#else
EEPROM_WRITE(dummy);
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
EEPROM_WRITE(y_endstop_adj); // 1 float
EEPROM_WRITE(endstops.y_endstop_adj); // 1 float
#else
EEPROM_WRITE(dummy);
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
EEPROM_WRITE(z_endstop_adj); // 1 float
EEPROM_WRITE(endstops.z_endstop_adj); // 1 float
#else
EEPROM_WRITE(dummy);
#endif
@@ -1070,17 +1070,17 @@ void MarlinSettings::postprocess() {
_FIELD_TEST(x_endstop_adj);
#if ENABLED(X_DUAL_ENDSTOPS)
EEPROM_READ(x_endstop_adj); // 1 float
EEPROM_READ(endstops.x_endstop_adj); // 1 float
#else
EEPROM_READ(dummy);
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
EEPROM_READ(y_endstop_adj); // 1 float
EEPROM_READ(endstops.y_endstop_adj); // 1 float
#else
EEPROM_READ(dummy);
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
EEPROM_READ(z_endstop_adj); // 1 float
EEPROM_READ(endstops.z_endstop_adj); // 1 float
#else
EEPROM_READ(dummy);
#endif
@@ -1638,7 +1638,7 @@ void MarlinSettings::reset() {
#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
#if ENABLED(X_DUAL_ENDSTOPS)
x_endstop_adj = (
endstops.x_endstop_adj = (
#ifdef X_DUAL_ENDSTOPS_ADJUSTMENT
X_DUAL_ENDSTOPS_ADJUSTMENT
#else
@@ -1647,7 +1647,7 @@ void MarlinSettings::reset() {
);
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
y_endstop_adj = (
endstops.y_endstop_adj = (
#ifdef Y_DUAL_ENDSTOPS_ADJUSTMENT
Y_DUAL_ENDSTOPS_ADJUSTMENT
#else
@@ -1656,7 +1656,7 @@ void MarlinSettings::reset() {
);
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
z_endstop_adj = (
endstops.z_endstop_adj = (
#ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT
Z_DUAL_ENDSTOPS_ADJUSTMENT
#else
@@ -2140,13 +2140,13 @@ void MarlinSettings::reset() {
CONFIG_ECHO_START;
SERIAL_ECHOPGM(" M666");
#if ENABLED(X_DUAL_ENDSTOPS)
SERIAL_ECHOPAIR(" X", LINEAR_UNIT(x_endstop_adj));
SERIAL_ECHOPAIR(" X", LINEAR_UNIT(endstops.x_endstop_adj));
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(y_endstop_adj));
SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(endstops.y_endstop_adj));
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(z_endstop_adj));
SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(endstops.z_endstop_adj));
#endif
SERIAL_EOL();
#endif // DELTA