|
|
@ -233,10 +233,10 @@ |
|
|
|
void report_polled_driver_data(TMC &st, const TMC_driver_data &data) { |
|
|
|
const uint32_t pwm_scale = get_pwm_scale(st); |
|
|
|
st.printLabel(); |
|
|
|
SERIAL_CHAR(':'); SERIAL_PRINT(pwm_scale, DEC); |
|
|
|
SERIAL_CHAR(':'); SERIAL_ECHO(pwm_scale); |
|
|
|
#if ENABLED(TMC_DEBUG) |
|
|
|
#if HAS_TMCX1X0 || HAS_TMC220x |
|
|
|
SERIAL_CHAR('/'); SERIAL_PRINT(data.cs_actual, DEC); |
|
|
|
SERIAL_CHAR('/'); SERIAL_ECHO(data.cs_actual); |
|
|
|
#endif |
|
|
|
#if HAS_STALLGUARD |
|
|
|
SERIAL_CHAR('/'); |
|
|
@ -257,7 +257,7 @@ |
|
|
|
#endif |
|
|
|
if (st.flag_otpw) SERIAL_CHAR('F'); // otpw Flag
|
|
|
|
SERIAL_CHAR('|'); |
|
|
|
if (st.otpw_count > 0) SERIAL_PRINT(st.otpw_count, DEC); |
|
|
|
if (st.otpw_count > 0) SERIAL_ECHO(st.otpw_count); |
|
|
|
SERIAL_CHAR('\t'); |
|
|
|
} |
|
|
|
|
|
|
@ -551,8 +551,8 @@ |
|
|
|
#if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC5130) |
|
|
|
static void _tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { |
|
|
|
switch (i) { |
|
|
|
case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; |
|
|
|
case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; |
|
|
|
case TMC_PWM_SCALE: SERIAL_ECHO(st.PWM_SCALE()); break; |
|
|
|
case TMC_SGT: SERIAL_ECHO(st.sgt()); break; |
|
|
|
case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break; |
|
|
|
case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break; |
|
|
|
default: break; |
|
|
@ -563,9 +563,9 @@ |
|
|
|
static void _tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) { |
|
|
|
switch (i) { |
|
|
|
case TMC_STALLGUARD: if (st.stallguard()) SERIAL_CHAR('*'); break; |
|
|
|
case TMC_SG_RESULT: SERIAL_PRINT(st.sg_result(), DEC); break; |
|
|
|
case TMC_SG_RESULT: SERIAL_ECHO(st.sg_result()); break; |
|
|
|
case TMC_FSACTIVE: if (st.fsactive()) SERIAL_CHAR('*'); break; |
|
|
|
case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break; |
|
|
|
case TMC_DRV_CS_ACTUAL: SERIAL_ECHO(st.cs_actual()); break; |
|
|
|
default: break; |
|
|
|
} |
|
|
|
} |
|
|
@ -580,13 +580,13 @@ |
|
|
|
|
|
|
|
static void _tmc_status(TMC2160Stepper &st, const TMC_debug_enum i) { |
|
|
|
switch (i) { |
|
|
|
case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; |
|
|
|
case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; |
|
|
|
case TMC_PWM_SCALE: SERIAL_ECHO(st.PWM_SCALE()); break; |
|
|
|
case TMC_SGT: SERIAL_ECHO(st.sgt()); break; |
|
|
|
case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break; |
|
|
|
case TMC_GLOBAL_SCALER: |
|
|
|
{ |
|
|
|
uint16_t value = st.GLOBAL_SCALER(); |
|
|
|
SERIAL_PRINT(value ?: 256, DEC); |
|
|
|
SERIAL_ECHO(value ? value : 256); |
|
|
|
SERIAL_ECHOPGM("/256"); |
|
|
|
} |
|
|
|
break; |
|
|
@ -599,10 +599,10 @@ |
|
|
|
#if HAS_TMC220x |
|
|
|
static void _tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { |
|
|
|
switch (i) { |
|
|
|
case TMC_PWM_SCALE_SUM: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break; |
|
|
|
case TMC_PWM_SCALE_AUTO: SERIAL_PRINT(st.pwm_scale_auto(), DEC); break; |
|
|
|
case TMC_PWM_OFS_AUTO: SERIAL_PRINT(st.pwm_ofs_auto(), DEC); break; |
|
|
|
case TMC_PWM_GRAD_AUTO: SERIAL_PRINT(st.pwm_grad_auto(), DEC); break; |
|
|
|
case TMC_PWM_SCALE_SUM: SERIAL_ECHO(st.pwm_scale_sum()); break; |
|
|
|
case TMC_PWM_SCALE_AUTO: SERIAL_ECHO(st.pwm_scale_auto()); break; |
|
|
|
case TMC_PWM_OFS_AUTO: SERIAL_ECHO(st.pwm_ofs_auto()); break; |
|
|
|
case TMC_PWM_GRAD_AUTO: SERIAL_ECHO(st.pwm_grad_auto()); break; |
|
|
|
case TMC_STEALTHCHOP: serialprint_truefalse(st.stealth()); break; |
|
|
|
case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break; |
|
|
|
default: break; |
|
|
@ -613,8 +613,8 @@ |
|
|
|
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID> |
|
|
|
static void _tmc_status(TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const TMC_debug_enum i) { |
|
|
|
switch (i) { |
|
|
|
case TMC_SGT: SERIAL_PRINT(st.SGTHRS(), DEC); break; |
|
|
|
case TMC_UART_ADDR: SERIAL_PRINT(st.get_address(), DEC); break; |
|
|
|
case TMC_SGT: SERIAL_ECHO(st.SGTHRS()); break; |
|
|
|
case TMC_UART_ADDR: SERIAL_ECHO(st.get_address()); break; |
|
|
|
default: |
|
|
|
TMC2208Stepper *parent = &st; |
|
|
|
_tmc_status(*parent, i); |
|
|
@ -631,7 +631,7 @@ |
|
|
|
case TMC_T120: if (st.t120()) SERIAL_CHAR('*'); break; |
|
|
|
case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('*'); break; |
|
|
|
case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('*'); break; |
|
|
|
case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break; |
|
|
|
case TMC_DRV_CS_ACTUAL: SERIAL_ECHO(st.cs_actual()); break; |
|
|
|
default: break; |
|
|
|
} |
|
|
|
} |
|
|
@ -639,7 +639,7 @@ |
|
|
|
#if HAS_DRIVER(TMC2209) |
|
|
|
static void _tmc_parse_drv_status(TMC2209Stepper &st, const TMC_drv_status_enum i) { |
|
|
|
switch (i) { |
|
|
|
case TMC_SG_RESULT: SERIAL_PRINT(st.SG_RESULT(), DEC); break; |
|
|
|
case TMC_SG_RESULT: SERIAL_ECHO(st.SG_RESULT()); break; |
|
|
|
default: _tmc_parse_drv_status(static_cast<TMC2208Stepper &>(st), i); break; |
|
|
|
} |
|
|
|
} |
|
|
@ -666,15 +666,15 @@ |
|
|
|
case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break; |
|
|
|
case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; |
|
|
|
case TMC_IRUN: |
|
|
|
SERIAL_PRINT(st.irun(), DEC); |
|
|
|
SERIAL_ECHO(st.irun()); |
|
|
|
SERIAL_ECHOPGM("/31"); |
|
|
|
break; |
|
|
|
case TMC_IHOLD: |
|
|
|
SERIAL_PRINT(st.ihold(), DEC); |
|
|
|
SERIAL_ECHO(st.ihold()); |
|
|
|
SERIAL_ECHOPGM("/31"); |
|
|
|
break; |
|
|
|
case TMC_CS_ACTUAL: |
|
|
|
SERIAL_PRINT(st.cs_actual(), DEC); |
|
|
|
SERIAL_ECHO(st.cs_actual()); |
|
|
|
SERIAL_ECHOPGM("/31"); |
|
|
|
break; |
|
|
|
case TMC_VSENSE: print_vsense(st); break; |
|
|
@ -694,11 +694,11 @@ |
|
|
|
#if ENABLED(MONITOR_DRIVER_STATUS) |
|
|
|
case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break; |
|
|
|
#endif |
|
|
|
case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break; |
|
|
|
case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break; |
|
|
|
case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break; |
|
|
|
case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break; |
|
|
|
case TMC_MSCNT: SERIAL_PRINT(st.get_microstep_counter(), DEC); break; |
|
|
|
case TMC_TOFF: SERIAL_ECHO(st.toff()); break; |
|
|
|
case TMC_TBL: SERIAL_ECHO(st.blank_time()); break; |
|
|
|
case TMC_HEND: SERIAL_ECHO(st.hysteresis_end()); break; |
|
|
|
case TMC_HSTRT: SERIAL_ECHO(st.hysteresis_start()); break; |
|
|
|
case TMC_MSCNT: SERIAL_ECHO(st.get_microstep_counter()); break; |
|
|
|
default: _tmc_status(st, i); break; |
|
|
|
} |
|
|
|
} |
|
|
@ -714,18 +714,18 @@ |
|
|
|
case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break; |
|
|
|
case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; |
|
|
|
case TMC_IRUN: |
|
|
|
SERIAL_PRINT(st.cs(), DEC); |
|
|
|
SERIAL_ECHO(st.cs()); |
|
|
|
SERIAL_ECHOPGM("/31"); |
|
|
|
break; |
|
|
|
case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.165") : PSTR("0=.310")); break; |
|
|
|
case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break; |
|
|
|
//case TMC_OTPW: serialprint_truefalse(st.otpw()); break;
|
|
|
|
//case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break;
|
|
|
|
case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; |
|
|
|
case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break; |
|
|
|
case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break; |
|
|
|
case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break; |
|
|
|
case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break; |
|
|
|
case TMC_SGT: SERIAL_ECHO(st.sgt()); break; |
|
|
|
case TMC_TOFF: SERIAL_ECHO(st.toff()); break; |
|
|
|
case TMC_TBL: SERIAL_ECHO(st.blank_time()); break; |
|
|
|
case TMC_HEND: SERIAL_ECHO(st.hysteresis_end()); break; |
|
|
|
case TMC_HSTRT: SERIAL_ECHO(st.hysteresis_start()); break; |
|
|
|
default: break; |
|
|
|
} |
|
|
|
} |
|
|
|