🎨 Standardize G-code reporting

This commit is contained in:
Scott Lahteine
2021-09-07 18:06:10 -05:00
committed by Scott Lahteine
parent a596faf4e5
commit 6d96c221bd
48 changed files with 1360 additions and 1170 deletions

View File

@ -144,4 +144,17 @@ void GcodeSuite::M900() {
}
void GcodeSuite::M900_report(const bool forReplay/*=true*/) {
report_heading(forReplay, PSTR(STR_LINEAR_ADVANCE));
#if EXTRUDERS < 2
report_echo_start(forReplay);
SERIAL_ECHOLNPAIR(" M900 K", planner.extruder_advance_K[0]);
#else
LOOP_L_N(i, EXTRUDERS) {
report_echo_start(forReplay);
SERIAL_ECHOLNPAIR(" M900 T", i, " K", planner.extruder_advance_K[i]);
}
#endif
}
#endif // LIN_ADVANCE

View File

@ -27,18 +27,6 @@
#include "../../gcode.h"
#include "../../../feature/controllerfan.h"
void M710_report(const bool forReplay=true) {
if (!forReplay) { SERIAL_ECHOLNPGM("; Controller Fan"); SERIAL_ECHO_START(); }
SERIAL_ECHOLNPAIR(" M710"
" S", int(controllerFan.settings.active_speed),
" I", int(controllerFan.settings.idle_speed),
" A", int(controllerFan.settings.auto_mode),
" D", controllerFan.settings.duration,
" ; (", (int(controllerFan.settings.active_speed) * 100) / 255, "%"
" ", (int(controllerFan.settings.idle_speed) * 100) / 255, "%)"
);
}
/**
* M710: Set controller fan settings
*
@ -78,4 +66,16 @@ void GcodeSuite::M710() {
M710_report();
}
void GcodeSuite::M710_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_CONTROLLER_FAN));
SERIAL_ECHOLNPAIR(" M710"
" S", int(controllerFan.settings.active_speed),
" I", int(controllerFan.settings.idle_speed),
" A", int(controllerFan.settings.auto_mode),
" D", controllerFan.settings.duration,
" ; (", (int(controllerFan.settings.active_speed) * 100) / 255, "%"
" ", (int(controllerFan.settings.idle_speed) * 100) / 255, "%)"
);
}
#endif // CONTROLLER_FAN_EDITABLE

View File

@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfig.h"
#if ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM, HAS_MOTOR_CURRENT_I2C, HAS_MOTOR_CURRENT_DAC)
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM || HAS_MOTOR_CURRENT_I2C || HAS_MOTOR_CURRENT_DAC
#include "../../gcode.h"
@ -44,12 +44,27 @@
void GcodeSuite::M907() {
#if HAS_MOTOR_CURRENT_SPI
if (!parser.seen("BS" LOGICAL_AXES_STRING))
return M907_report();
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.set_digipot_current(i, parser.value_int());
if (parser.seenval('B')) stepper.set_digipot_current(4, parser.value_int());
if (parser.seenval('S')) LOOP_LE_N(i, 4) stepper.set_digipot_current(i, parser.value_int());
#elif HAS_MOTOR_CURRENT_PWM
if (!parser.seen(
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY)
"XY"
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
"Z"
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
"E"
#endif
)) return M907_report();
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY)
if (parser.seenval('X') || parser.seenval('Y')) stepper.set_digipot_current(0, parser.value_int());
#endif
@ -82,7 +97,30 @@ void GcodeSuite::M907() {
#endif
}
#if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC)
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
void GcodeSuite::M907_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_STEPPER_MOTOR_CURRENTS));
#if HAS_MOTOR_CURRENT_PWM
SERIAL_ECHOLNPAIR_P( // PWM-based has 3 values:
PSTR(" M907 X"), stepper.motor_current_setting[0] // X and Y
, SP_Z_STR, stepper.motor_current_setting[1] // Z
, SP_E_STR, stepper.motor_current_setting[2] // E
);
#elif HAS_MOTOR_CURRENT_SPI
SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values:
LOOP_LOGICAL_AXES(q) { // X Y Z (I J K) E (map to X Y Z (I J K) E0 by default)
SERIAL_CHAR(' ', axis_codes[q]);
SERIAL_ECHO(stepper.motor_current_setting[q]);
}
SERIAL_CHAR(' ', 'B'); // B (maps to E1 by default)
SERIAL_ECHOLN(stepper.motor_current_setting[4]);
#endif
}
#endif // HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_DAC
/**
* M908: Control digital trimpot directly (M908 P<pin> S<current>)

View File

@ -29,14 +29,34 @@
/**
* M207: Set firmware retraction values
*
* S[+units] retract_length
* W[+units] swap_retract_length (multi-extruder)
* F[units/min] retract_feedrate_mm_s
* Z[units] retract_zraise
*/
void GcodeSuite::M207() { fwretract.M207(); }
void GcodeSuite::M207_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_RETRACT_S_F_Z));
fwretract.M207_report();
}
/**
* M208: Set firmware un-retraction values
*
* S[+units] retract_recover_extra (in addition to M207 S*)
* W[+units] swap_retract_recover_extra (multi-extruder)
* F[units/min] retract_recover_feedrate_mm_s
* R[units/min] swap_retract_recover_feedrate_mm_s
*/
void GcodeSuite::M208() { fwretract.M208(); }
void GcodeSuite::M208_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_RECOVER_S_F));
fwretract.M208_report();
}
#if ENABLED(FWRETRACT_AUTORETRACT)
/**
@ -47,6 +67,11 @@ void GcodeSuite::M208() { fwretract.M208(); }
*/
void GcodeSuite::M209() { fwretract.M209(); }
void GcodeSuite::M209_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_AUTO_RETRACT_S));
fwretract.M209_report();
}
#endif
#endif // FWRETRACT

View File

@ -64,17 +64,7 @@ void ip_report(const uint16_t cmd, PGM_P const post, const IPAddress &ipo) {
if (i < 3) SERIAL_CHAR('.');
}
SERIAL_ECHOPGM(" ; ");
SERIAL_ECHOPGM_P(post);
SERIAL_EOL();
}
void M552_report() {
ip_report(552, PSTR("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip);
}
void M553_report() {
ip_report(553, PSTR("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet);
}
void M554_report() {
ip_report(554, PSTR("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway);
SERIAL_ECHOLNPGM_P(post);
}
/**
@ -107,20 +97,36 @@ void GcodeSuite::M552() {
if (nopar || seenP) M552_report();
}
void GcodeSuite::M552_report() {
ip_report(552, PSTR("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip);
}
/**
* M553 Pnnn - Set netmask
*/
void GcodeSuite::M553() {
if (parser.seenval('P')) ethernet.subnet.fromString(parser.value_string());
M553_report();
if (parser.seenval('P'))
ethernet.subnet.fromString(parser.value_string());
else
M553_report();
}
void GcodeSuite::M553_report() {
ip_report(553, PSTR("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet);
}
/**
* M554 Pnnn - Set Gateway
*/
void GcodeSuite::M554() {
if (parser.seenval('P')) ethernet.gateway.fromString(parser.value_string());
M554_report();
if (parser.seenval('P'))
ethernet.gateway.fromString(parser.value_string());
else
M554_report();
}
void GcodeSuite::M554_report() {
ip_report(554, PSTR("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway);
}
#endif // HAS_ETHERNET

View File

@ -42,6 +42,8 @@
*/
void GcodeSuite::M603() {
if (!parser.seen("TUL")) return M603_report();
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
@ -62,4 +64,20 @@ void GcodeSuite::M603() {
}
}
void GcodeSuite::M603_report(const bool forReplay/*=true*/) {
report_heading(forReplay, PSTR(STR_FILAMENT_LOAD_UNLOAD));
#if EXTRUDERS == 1
report_echo_start(forReplay);
SERIAL_ECHOPAIR(" M603 L", LINEAR_UNIT(fc_settings[0].load_length), " U", LINEAR_UNIT(fc_settings[0].unload_length), " ;");
say_units();
#else
LOOP_L_N(e, EXTRUDERS) {
report_echo_start(forReplay);
SERIAL_ECHOPAIR(" M603 T", e, " L", LINEAR_UNIT(fc_settings[e].load_length), " U", LINEAR_UNIT(fc_settings[e].unload_length), " ;");
say_units();
}
#endif
}
#endif // ADVANCED_PAUSE_FEATURE

View File

@ -40,11 +40,8 @@ void GcodeSuite::M413() {
if (parser.seen('S'))
recovery.enable(parser.value_bool());
else {
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Power-loss recovery ");
serialprintln_onoff(recovery.enabled);
}
else
M413_report();
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
if (parser.seen("RL")) recovery.load();
@ -59,4 +56,10 @@ void GcodeSuite::M413() {
#endif
}
void GcodeSuite::M413_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_POWER_LOSS_RECOVERY));
SERIAL_ECHOPAIR(" M413 S", AS_DIGIT(recovery.enabled), " ; ");
serialprintln_onoff(recovery.enabled);
}
#endif // POWER_LOSS_RECOVERY

View File

@ -66,4 +66,16 @@ void GcodeSuite::M412() {
}
}
void GcodeSuite::M412_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, PSTR(STR_FILAMENT_RUNOUT_SENSOR));
SERIAL_ECHOLNPAIR(
" M412 S", runout.enabled
#if HAS_FILAMENT_RUNOUT_DISTANCE
, " D", LINEAR_UNIT(runout.runout_distance())
#endif
, " ; Sensor "
);
serialprintln_onoff(runout.enabled);
}
#endif // HAS_FILAMENT_SENSOR

View File

@ -138,4 +138,66 @@ void GcodeSuite::M569() {
say_stealth_status();
}
void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
report_heading(forReplay, PSTR(STR_DRIVER_STEPPING_MODE));
auto say_M569 = [](const bool forReplay, const char * const etc=nullptr, const bool eol=false) {
if (!forReplay) SERIAL_ECHO_START();
SERIAL_ECHOPGM(" M569 S1");
if (etc) {
SERIAL_CHAR(' ');
SERIAL_ECHOPGM_P(etc);
}
if (eol) SERIAL_EOL();
};
const bool chop_x = TERN0(X_HAS_STEALTHCHOP, stepperX.get_stored_stealthChop()),
chop_y = TERN0(Y_HAS_STEALTHCHOP, stepperY.get_stored_stealthChop()),
chop_z = TERN0(Z_HAS_STEALTHCHOP, stepperZ.get_stored_stealthChop()),
chop_i = TERN0(I_HAS_STEALTHCHOP, stepperI.get_stored_stealthChop()),
chop_j = TERN0(J_HAS_STEALTHCHOP, stepperJ.get_stored_stealthChop()),
chop_k = TERN0(K_HAS_STEALTHCHOP, stepperK.get_stored_stealthChop());
if (chop_x || chop_y || chop_z || chop_i || chop_j || chop_k) {
say_M569(forReplay);
LINEAR_AXIS_CODE(
if (chop_x) SERIAL_ECHOPGM_P(SP_X_STR),
if (chop_y) SERIAL_ECHOPGM_P(SP_Y_STR),
if (chop_z) SERIAL_ECHOPGM_P(SP_Z_STR),
if (chop_i) SERIAL_ECHOPGM_P(SP_I_STR),
if (chop_j) SERIAL_ECHOPGM_P(SP_J_STR),
if (chop_k) SERIAL_ECHOPGM_P(SP_K_STR)
);
SERIAL_EOL();
}
const bool chop_x2 = TERN0(X2_HAS_STEALTHCHOP, stepperX2.get_stored_stealthChop()),
chop_y2 = TERN0(Y2_HAS_STEALTHCHOP, stepperY2.get_stored_stealthChop()),
chop_z2 = TERN0(Z2_HAS_STEALTHCHOP, stepperZ2.get_stored_stealthChop());
if (chop_x2 || chop_y2 || chop_z2) {
say_M569(forReplay, PSTR("I1"));
if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
SERIAL_EOL();
}
if (TERN0(Z3_HAS_STEALTHCHOP, stepperZ3.get_stored_stealthChop())) { say_M569(forReplay, PSTR("I2 Z"), true); }
if (TERN0(Z4_HAS_STEALTHCHOP, stepperZ4.get_stored_stealthChop())) { say_M569(forReplay, PSTR("I3 Z"), true); }
if (TERN0( I_HAS_STEALTHCHOP, stepperI.get_stored_stealthChop())) { say_M569(forReplay, SP_I_STR, true); }
if (TERN0( J_HAS_STEALTHCHOP, stepperJ.get_stored_stealthChop())) { say_M569(forReplay, SP_J_STR, true); }
if (TERN0( K_HAS_STEALTHCHOP, stepperK.get_stored_stealthChop())) { say_M569(forReplay, SP_K_STR, true); }
if (TERN0(E0_HAS_STEALTHCHOP, stepperE0.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T0 E"), true); }
if (TERN0(E1_HAS_STEALTHCHOP, stepperE1.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T1 E"), true); }
if (TERN0(E2_HAS_STEALTHCHOP, stepperE2.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T2 E"), true); }
if (TERN0(E3_HAS_STEALTHCHOP, stepperE3.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T3 E"), true); }
if (TERN0(E4_HAS_STEALTHCHOP, stepperE4.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T4 E"), true); }
if (TERN0(E5_HAS_STEALTHCHOP, stepperE5.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T5 E"), true); }
if (TERN0(E6_HAS_STEALTHCHOP, stepperE6.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T6 E"), true); }
if (TERN0(E7_HAS_STEALTHCHOP, stepperE7.get_stored_stealthChop())) { say_M569(forReplay, PSTR("T7 E"), true); }
}
#endif // HAS_STEALTHCHOP

View File

@ -198,4 +198,99 @@ void GcodeSuite::M906() {
}
}
void GcodeSuite::M906_report(const bool forReplay/*=true*/) {
report_heading(forReplay, PSTR(STR_STEPPER_DRIVER_CURRENT));
auto say_M906 = [](const bool forReplay) {
report_echo_start(forReplay);
SERIAL_ECHOPGM(" M906");
};
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
say_M906(forReplay);
#if AXIS_IS_TMC(X)
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.getMilliamps());
#endif
#if AXIS_IS_TMC(Y)
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.getMilliamps());
#endif
#if AXIS_IS_TMC(Z)
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.getMilliamps());
#endif
SERIAL_EOL();
#endif
#if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
say_M906(forReplay);
SERIAL_ECHOPGM(" I1");
#if AXIS_IS_TMC(X2)
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.getMilliamps());
#endif
#if AXIS_IS_TMC(Y2)
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.getMilliamps());
#endif
#if AXIS_IS_TMC(Z2)
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.getMilliamps());
#endif
SERIAL_EOL();
#endif
#if AXIS_IS_TMC(Z3)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.getMilliamps());
#endif
#if AXIS_IS_TMC(Z4)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" I3 Z", stepperZ4.getMilliamps());
#endif
#if AXIS_IS_TMC(I)
say_M906(forReplay);
SERIAL_ECHOLNPAIR_P(SP_I_STR, stepperI.getMilliamps());
#endif
#if AXIS_IS_TMC(J)
say_M906(forReplay);
SERIAL_ECHOLNPAIR_P(SP_J_STR, stepperJ.getMilliamps());
#endif
#if AXIS_IS_TMC(K)
say_M906(forReplay);
SERIAL_ECHOLNPAIR_P(SP_K_STR, stepperK.getMilliamps());
#endif
#if AXIS_IS_TMC(E0)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T0 E", stepperE0.getMilliamps());
#endif
#if AXIS_IS_TMC(E1)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T1 E", stepperE1.getMilliamps());
#endif
#if AXIS_IS_TMC(E2)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T2 E", stepperE2.getMilliamps());
#endif
#if AXIS_IS_TMC(E3)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T3 E", stepperE3.getMilliamps());
#endif
#if AXIS_IS_TMC(E4)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T4 E", stepperE4.getMilliamps());
#endif
#if AXIS_IS_TMC(E5)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T5 E", stepperE5.getMilliamps());
#endif
#if AXIS_IS_TMC(E6)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T6 E", stepperE6.getMilliamps());
#endif
#if AXIS_IS_TMC(E7)
say_M906(forReplay);
SERIAL_ECHOLNPAIR(" T7 E", stepperE7.getMilliamps());
#endif
SERIAL_EOL();
}
#endif // HAS_TRINAMIC_CONFIG

View File

@ -227,6 +227,7 @@
* M913: Set HYBRID_THRESHOLD speed.
*/
#if ENABLED(HYBRID_THRESHOLD)
void GcodeSuite::M913() {
#define TMC_SAY_PWMTHRS(A,Q) tmc_print_pwmthrs(stepper##Q)
#define TMC_SET_PWMTHRS(A,Q) stepper##Q.set_pwm_thrs(value)
@ -308,12 +309,109 @@
TERN_(E7_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(7));
}
}
void GcodeSuite::M913_report(const bool forReplay/*=true*/) {
report_heading(forReplay, PSTR(STR_HYBRID_THRESHOLD));
auto say_M913 = [](const bool forReplay) {
report_echo_start(forReplay);
SERIAL_ECHOPGM(" M913");
};
#if X_HAS_STEALTHCHOP || Y_HAS_STEALTHCHOP || Z_HAS_STEALTHCHOP
say_M913(forReplay);
#if X_HAS_STEALTHCHOP
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.get_pwm_thrs());
#endif
#if Y_HAS_STEALTHCHOP
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.get_pwm_thrs());
#endif
#if Z_HAS_STEALTHCHOP
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.get_pwm_thrs());
#endif
SERIAL_EOL();
#endif
#if X2_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOPGM(" I1");
#if X2_HAS_STEALTHCHOP
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.get_pwm_thrs());
#endif
#if Y2_HAS_STEALTHCHOP
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.get_pwm_thrs());
#endif
#if Z2_HAS_STEALTHCHOP
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.get_pwm_thrs());
#endif
SERIAL_EOL();
#endif
#if Z3_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.get_pwm_thrs());
#endif
#if Z4_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" I3 Z", stepperZ4.get_pwm_thrs());
#endif
#if I_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR_P(SP_I_STR, stepperI.get_pwm_thrs());
#endif
#if J_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR_P(SP_J_STR, stepperJ.get_pwm_thrs());
#endif
#if K_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR_P(SP_K_STR, stepperK.get_pwm_thrs());
#endif
#if E0_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T0 E", stepperE0.get_pwm_thrs());
#endif
#if E1_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T1 E", stepperE1.get_pwm_thrs());
#endif
#if E2_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T2 E", stepperE2.get_pwm_thrs());
#endif
#if E3_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T3 E", stepperE3.get_pwm_thrs());
#endif
#if E4_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T4 E", stepperE4.get_pwm_thrs());
#endif
#if E5_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T5 E", stepperE5.get_pwm_thrs());
#endif
#if E6_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T6 E", stepperE6.get_pwm_thrs());
#endif
#if E7_HAS_STEALTHCHOP
say_M913(forReplay);
SERIAL_ECHOLNPAIR(" T7 E", stepperE7.get_pwm_thrs());
#endif
SERIAL_EOL();
}
#endif // HYBRID_THRESHOLD
/**
* M914: Set StallGuard sensitivity.
*/
#if USE_SENSORLESS
void GcodeSuite::M914() {
bool report = true;
@ -412,6 +510,68 @@
#endif
}
}
void GcodeSuite::M914_report(const bool forReplay/*=true*/) {
report_heading(forReplay, PSTR(STR_STALLGUARD_THRESHOLD));
auto say_M914 = [](const bool forReplay) {
report_echo_start(forReplay);
SERIAL_ECHOPGM(" M914");
};
#if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
say_M914(forReplay);
#if X_SENSORLESS
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.homing_threshold());
#endif
#if Y_SENSORLESS
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.homing_threshold());
#endif
#if Z_SENSORLESS
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.homing_threshold());
#endif
SERIAL_EOL();
#endif
#if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS
say_M914(forReplay);
SERIAL_ECHOPGM(" I1");
#if X2_SENSORLESS
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.homing_threshold());
#endif
#if Y2_SENSORLESS
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.homing_threshold());
#endif
#if Z2_SENSORLESS
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.homing_threshold());
#endif
SERIAL_EOL();
#endif
#if Z3_SENSORLESS
say_M914(forReplay);
SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold());
#endif
#if Z4_SENSORLESS
say_M914(forReplay);
SERIAL_ECHOLNPAIR(" I3 Z", stepperZ4.homing_threshold());
#endif
#if I_SENSORLESS
say_M914(forReplay);
SERIAL_ECHOLNPAIR_P(SP_I_STR, stepperI.homing_threshold());
#endif
#if J_SENSORLESS
say_M914(forReplay);
SERIAL_ECHOLNPAIR_P(SP_J_STR, stepperJ.homing_threshold());
#endif
#if K_SENSORLESS
say_M914(forReplay);
SERIAL_ECHOLNPAIR_P(SP_K_STR, stepperK.homing_threshold());
#endif
}
#endif // USE_SENSORLESS
#endif // HAS_TRINAMIC_CONFIG