Fix M503 helper functions following TMC updates (#10197)

This commit is contained in:
Bob-the-Kuhn 2018-03-23 16:43:43 -05:00 committed by Scott Lahteine
parent bb7236a750
commit 8870f9b1da

View file

@ -1893,15 +1893,15 @@ void MarlinSettings::reset(PORTARG_SOLO) {
#define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START_P(port); }while(0) #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START_P(port); }while(0)
#if HAS_TRINAMIC #if HAS_TRINAMIC
void say_M906() { SERIAL_ECHOPGM_P(port, " M906 "); } void say_M906(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, " M906 "); }
void say_M913() { SERIAL_ECHOPGM_P(port, " M913 "); } void say_M913(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, " M913 "); }
#if ENABLED(SENSORLESS_HOMING) #if ENABLED(SENSORLESS_HOMING)
void say_M914() { SERIAL_ECHOPGM_P(port, " M914 "); } void say_M914(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, " M914 "); }
#endif #endif
#endif #endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
void say_M603() { SERIAL_ECHOPGM_P(port, " M603 "); } #define say_M603(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, " M603 "); }
#endif #endif
/** /**
@ -2382,47 +2382,47 @@ void MarlinSettings::reset(PORTARG_SOLO) {
} }
CONFIG_ECHO_START; CONFIG_ECHO_START;
#if X_IS_TRINAMIC #if X_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "X", stepperX.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "X", stepperX.getCurrent());
#endif #endif
#if X2_IS_TRINAMIC #if X2_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 X", stepperX2.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "I1 X", stepperX2.getCurrent());
#endif #endif
#if Y_IS_TRINAMIC #if Y_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Y", stepperY.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "Y", stepperY.getCurrent());
#endif #endif
#if Y2_IS_TRINAMIC #if Y2_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Y", stepperY2.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "I1 Y", stepperY2.getCurrent());
#endif #endif
#if Z_IS_TRINAMIC #if Z_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Z", stepperZ.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "Z", stepperZ.getCurrent());
#endif #endif
#if Z2_IS_TRINAMIC #if Z2_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Z", stepperZ2.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "I1 Z", stepperZ2.getCurrent());
#endif #endif
#if E0_IS_TRINAMIC #if E0_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T0 E", stepperE0.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "T0 E", stepperE0.getCurrent());
#endif #endif
#if E_STEPPERS > 1 && E1_IS_TRINAMIC #if E_STEPPERS > 1 && E1_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T1 E", stepperE1.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "T1 E", stepperE1.getCurrent());
#endif #endif
#if E_STEPPERS > 2 && E2_IS_TRINAMIC #if E_STEPPERS > 2 && E2_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T2 E", stepperE2.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "T2 E", stepperE2.getCurrent());
#endif #endif
#if E_STEPPERS > 3 && E3_IS_TRINAMIC #if E_STEPPERS > 3 && E3_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T3 E", stepperE3.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "T3 E", stepperE3.getCurrent());
#endif #endif
#if E_STEPPERS > 4 && E4_IS_TRINAMIC #if E_STEPPERS > 4 && E4_IS_TRINAMIC
say_M906(); say_M906(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T4 E", stepperE4.getCurrent()); SERIAL_ECHOLNPAIR_P(port, "T4 E", stepperE4.getCurrent());
#endif #endif
SERIAL_EOL_P(port); SERIAL_EOL_P(port);
@ -2436,47 +2436,47 @@ void MarlinSettings::reset(PORTARG_SOLO) {
} }
CONFIG_ECHO_START; CONFIG_ECHO_START;
#if X_IS_TRINAMIC #if X_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "X", TMC_GET_PWMTHRS(X, X)); SERIAL_ECHOLNPAIR_P(port, "X", TMC_GET_PWMTHRS(X, X));
#endif #endif
#if X2_IS_TRINAMIC #if X2_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 X", TMC_GET_PWMTHRS(X, X2)); SERIAL_ECHOLNPAIR_P(port, "I1 X", TMC_GET_PWMTHRS(X, X2));
#endif #endif
#if Y_IS_TRINAMIC #if Y_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Y", TMC_GET_PWMTHRS(Y, Y)); SERIAL_ECHOLNPAIR_P(port, "Y", TMC_GET_PWMTHRS(Y, Y));
#endif #endif
#if Y2_IS_TRINAMIC #if Y2_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Y", TMC_GET_PWMTHRS(Y, Y2)); SERIAL_ECHOLNPAIR_P(port, "I1 Y", TMC_GET_PWMTHRS(Y, Y2));
#endif #endif
#if Z_IS_TRINAMIC #if Z_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Z", TMC_GET_PWMTHRS(Z, Z)); SERIAL_ECHOLNPAIR_P(port, "Z", TMC_GET_PWMTHRS(Z, Z));
#endif #endif
#if Z2_IS_TRINAMIC #if Z2_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Z", TMC_GET_PWMTHRS(Z, Z2)); SERIAL_ECHOLNPAIR_P(port, "I1 Z", TMC_GET_PWMTHRS(Z, Z2));
#endif #endif
#if E0_IS_TRINAMIC #if E0_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T0 E", TMC_GET_PWMTHRS(E, E0)); SERIAL_ECHOLNPAIR_P(port, "T0 E", TMC_GET_PWMTHRS(E, E0));
#endif #endif
#if E_STEPPERS > 1 && E1_IS_TRINAMIC #if E_STEPPERS > 1 && E1_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T1 E", TMC_GET_PWMTHRS(E, E1)); SERIAL_ECHOLNPAIR_P(port, "T1 E", TMC_GET_PWMTHRS(E, E1));
#endif #endif
#if E_STEPPERS > 2 && E2_IS_TRINAMIC #if E_STEPPERS > 2 && E2_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T2 E", TMC_GET_PWMTHRS(E, E2)); SERIAL_ECHOLNPAIR_P(port, "T2 E", TMC_GET_PWMTHRS(E, E2));
#endif #endif
#if E_STEPPERS > 3 && E3_IS_TRINAMIC #if E_STEPPERS > 3 && E3_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T3 E", TMC_GET_PWMTHRS(E, E3)); SERIAL_ECHOLNPAIR_P(port, "T3 E", TMC_GET_PWMTHRS(E, E3));
#endif #endif
#if E_STEPPERS > 4 && E4_IS_TRINAMIC #if E_STEPPERS > 4 && E4_IS_TRINAMIC
say_M913(); say_M913(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "T4 E", TMC_GET_PWMTHRS(E, E4)); SERIAL_ECHOLNPAIR_P(port, "T4 E", TMC_GET_PWMTHRS(E, E4));
#endif #endif
SERIAL_EOL_P(port); SERIAL_EOL_P(port);
@ -2492,31 +2492,31 @@ void MarlinSettings::reset(PORTARG_SOLO) {
CONFIG_ECHO_START; CONFIG_ECHO_START;
#ifdef X_HOMING_SENSITIVITY #ifdef X_HOMING_SENSITIVITY
#if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
say_M914(); say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "X", stepperX.sgt()); SERIAL_ECHOLNPAIR_P(port, "X", stepperX.sgt());
#endif #endif
#if ENABLED(X2_IS_TMC2130) #if ENABLED(X2_IS_TMC2130)
say_M914(); say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 X", stepperX2.sgt()); SERIAL_ECHOLNPAIR_P(port, "I1 X", stepperX2.sgt());
#endif #endif
#endif #endif
#ifdef Y_HOMING_SENSITIVITY #ifdef Y_HOMING_SENSITIVITY
#if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
say_M914(); say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Y", stepperY.sgt()); SERIAL_ECHOLNPAIR_P(port, "Y", stepperY.sgt());
#endif #endif
#if ENABLED(Y2_IS_TMC2130) #if ENABLED(Y2_IS_TMC2130)
say_M914(); say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Y", stepperY2.sgt()); SERIAL_ECHOLNPAIR_P(port, "I1 Y", stepperY2.sgt());
#endif #endif
#endif #endif
#ifdef Z_HOMING_SENSITIVITY #ifdef Z_HOMING_SENSITIVITY
#if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
say_M914(); say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "Z", stepperZ.sgt()); SERIAL_ECHOLNPAIR_P(port, "Z", stepperZ.sgt());
#endif #endif
#if ENABLED(Z2_IS_TMC2130) #if ENABLED(Z2_IS_TMC2130)
say_M914(); say_M914(PORTVAR_SOLO);
SERIAL_ECHOLNPAIR_P(port, "I1 Z", stepperZ2.sgt()); SERIAL_ECHOLNPAIR_P(port, "I1 Z", stepperZ2.sgt());
#endif #endif
#endif #endif
@ -2559,30 +2559,30 @@ void MarlinSettings::reset(PORTARG_SOLO) {
} }
CONFIG_ECHO_START; CONFIG_ECHO_START;
#if EXTRUDERS == 1 #if EXTRUDERS == 1
say_M603(); say_M603(PORTVAR_SOLO);
SERIAL_ECHOPAIR_P(port, "L", LINEAR_UNIT(filament_change_load_length[0])); SERIAL_ECHOPAIR_P(port, "L", LINEAR_UNIT(filament_change_load_length[0]));
SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[0])); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[0]));
#else #else
say_M603(); say_M603(PORTVAR_SOLO);
SERIAL_ECHOPAIR_P(port, "T0 L", LINEAR_UNIT(filament_change_load_length[0])); SERIAL_ECHOPAIR_P(port, "T0 L", LINEAR_UNIT(filament_change_load_length[0]));
SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[0])); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[0]));
CONFIG_ECHO_START; CONFIG_ECHO_START;
say_M603(); say_M603(PORTVAR_SOLO);
SERIAL_ECHOPAIR_P(port, "T1 L", LINEAR_UNIT(filament_change_load_length[1])); SERIAL_ECHOPAIR_P(port, "T1 L", LINEAR_UNIT(filament_change_load_length[1]));
SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[1])); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[1]));
#if EXTRUDERS > 2 #if EXTRUDERS > 2
CONFIG_ECHO_START; CONFIG_ECHO_START;
say_M603(); say_M603(PORTVAR_SOLO);
SERIAL_ECHOPAIR_P(port, "T2 L", LINEAR_UNIT(filament_change_load_length[2])); SERIAL_ECHOPAIR_P(port, "T2 L", LINEAR_UNIT(filament_change_load_length[2]));
SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[2])); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[2]));
#if EXTRUDERS > 3 #if EXTRUDERS > 3
CONFIG_ECHO_START; CONFIG_ECHO_START;
say_M603(); say_M603(PORTVAR_SOLO);
SERIAL_ECHOPAIR_P(port, "T3 L", LINEAR_UNIT(filament_change_load_length[3])); SERIAL_ECHOPAIR_P(port, "T3 L", LINEAR_UNIT(filament_change_load_length[3]));
SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[3])); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[3]));
#if EXTRUDERS > 4 #if EXTRUDERS > 4
CONFIG_ECHO_START; CONFIG_ECHO_START;
say_M603(); say_M603(PORTVAR_SOLO);
SERIAL_ECHOPAIR_P(port, "T4 L", LINEAR_UNIT(filament_change_load_length[4])); SERIAL_ECHOPAIR_P(port, "T4 L", LINEAR_UNIT(filament_change_load_length[4]));
SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[4])); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(filament_change_unload_length[4]));
#endif // EXTRUDERS > 4 #endif // EXTRUDERS > 4