More concise M503 output for M906, M913, M914 (#10947)

This commit is contained in:
Scott Lahteine 2018-06-06 20:58:28 -05:00 committed by GitHub
parent eb1026d438
commit d8b983f624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2409,29 +2409,36 @@ void MarlinSettings::reset(PORTARG_SOLO) {
SERIAL_ECHOLNPGM_P(port, "Stepper driver current:");
}
CONFIG_ECHO_START;
#if X_IS_TRINAMIC
#if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "X", stepperX.getCurrent());
#endif
#if X2_IS_TRINAMIC
say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 X", stepperX2.getCurrent());
#if X_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " X", stepperX.getCurrent());
#endif
#if Y_IS_TRINAMIC
say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Y", stepperY.getCurrent());
#endif
#if Y2_IS_TRINAMIC
say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Y", stepperY2.getCurrent());
SERIAL_ECHOPAIR_P(port, " Y", stepperY.getCurrent());
#endif
#if Z_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " Z", stepperZ.getCurrent());
#endif
#if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
SERIAL_EOL_P(port);
#endif
#if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Z", stepperZ.getCurrent());
SERIAL_ECHOPGM_P(port, " I1");
#endif
#if X2_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " X", stepperX2.getCurrent());
#endif
#if Y2_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " Y", stepperY2.getCurrent());
#endif
#if Z2_IS_TRINAMIC
say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Z", stepperZ2.getCurrent());
SERIAL_ECHOPAIR_P(port, " Z", stepperZ2.getCurrent());
#endif
#if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
SERIAL_EOL_P(port);
#endif
#if E0_IS_TRINAMIC
say_M906(PORTVAR_SOLO);
@ -2464,29 +2471,36 @@ void MarlinSettings::reset(PORTARG_SOLO) {
SERIAL_ECHOLNPGM_P(port, "Hybrid Threshold:");
}
CONFIG_ECHO_START;
#if X_IS_TRINAMIC
#if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "X", TMC_GET_PWMTHRS(X, X));
#endif
#if X2_IS_TRINAMIC
say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 X", TMC_GET_PWMTHRS(X, X2));
#if X_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X));
#endif
#if Y_IS_TRINAMIC
say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Y", TMC_GET_PWMTHRS(Y, Y));
#endif
#if Y2_IS_TRINAMIC
say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Y", TMC_GET_PWMTHRS(Y, Y2));
SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y));
#endif
#if Z_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z));
#endif
#if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
SERIAL_EOL_P(port);
#endif
#if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Z", TMC_GET_PWMTHRS(Z, Z));
SERIAL_ECHOPGM_P(port, " I1");
#endif
#if X2_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X2));
#endif
#if Y2_IS_TRINAMIC
SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y2));
#endif
#if Z2_IS_TRINAMIC
say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Z", TMC_GET_PWMTHRS(Z, Z2));
SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z2));
#endif
#if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
SERIAL_EOL_P(port);
#endif
#if E0_IS_TRINAMIC
say_M913(PORTVAR_SOLO);
@ -2520,39 +2534,43 @@ void MarlinSettings::reset(PORTARG_SOLO) {
SERIAL_ECHOLNPGM_P(port, "Sensorless homing threshold:");
}
CONFIG_ECHO_START;
#ifdef X_HOMING_SENSITIVITY
#if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
#define HAS_X_SENSORLESS (defined(X_HOMING_SENSITIVITY) && (ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)))
#define HAS_Y_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && (ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)))
#define HAS_Z_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && (ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)))
#if HAS_X_SENSORLESS || HAS_Y_SENSORLESS || HAS_Z_SENSORLESS
say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "X", stepperX.sgt());
#if HAS_X_SENSORLESS
SERIAL_ECHOPAIR_P(port, " X", stepperX.sgt());
#endif
#if ENABLED(X2_IS_TMC2130)
say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 X", stepperX2.sgt());
#endif
#endif
#ifdef Y_HOMING_SENSITIVITY
#if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Y", stepperY.sgt());
#endif
#if ENABLED(Y2_IS_TMC2130)
say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Y", stepperY2.sgt());
#endif
#endif
#ifdef Z_HOMING_SENSITIVITY
#if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Z", stepperZ.sgt());
#endif
#if ENABLED(Z2_IS_TMC2130)
say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Z", stepperZ2.sgt());
#if HAS_Y_SENSORLESS
SERIAL_ECHOPAIR_P(port, " Y", stepperY.sgt());
#endif
#if HAS_Z_SENSORLESS
SERIAL_ECHOPAIR_P(port, " Z", stepperZ.sgt());
#endif
SERIAL_EOL_P(port);
#endif
#define HAS_X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && ENABLED(X2_IS_TMC2130))
#define HAS_Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && ENABLED(Y2_IS_TMC2130))
#define HAS_Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && ENABLED(Z2_IS_TMC2130))
#if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS
say_M914(PORTVAR_SOLO);
SERIAL_ECHOPGM_P(port, " I1");
#if HAS_X2_SENSORLESS
SERIAL_ECHOPAIR_P(port, " X", stepperX2.sgt());
#endif
#if HAS_Y2_SENSORLESS
SERIAL_ECHOPAIR_P(port, " Y", stepperY2.sgt());
#endif
#if HAS_Z2_SENSORLESS
SERIAL_ECHOPAIR_P(port, " Z", stepperZ2.sgt());
#endif
SERIAL_EOL_P(port);
#endif
#endif // SENSORLESS_HOMING
#endif // HAS_TRINAMIC
/**