From 07b1ac06a9aa25ce7114820d1fb876ed3642d8a9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 14 Mar 2018 04:10:24 -0500 Subject: [PATCH] More concise tmc_util output, fix a ternary type --- Marlin/tmc_util.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/tmc_util.cpp b/Marlin/tmc_util.cpp index d7e3c737b..e2d60bf7a 100644 --- a/Marlin/tmc_util.cpp +++ b/Marlin/tmc_util.cpp @@ -227,11 +227,11 @@ void _tmc_say_axis(const TMC_AxisEnum axis) { void _tmc_say_current(const TMC_AxisEnum axis, const uint16_t curr) { _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" axis driver current: ", curr); + SERIAL_ECHOLNPAIR(" driver current: ", curr); } void _tmc_say_otpw(const TMC_AxisEnum axis, const bool otpw) { _tmc_say_axis(axis); - SERIAL_ECHOPGM(" axis temperature prewarn triggered: "); + SERIAL_ECHOPGM(" temperature prewarn triggered: "); serialprintPGM(otpw ? PSTR("true") : PSTR("false")); SERIAL_EOL(); } @@ -241,11 +241,11 @@ void _tmc_say_otpw_cleared(const TMC_AxisEnum axis) { } void _tmc_say_pwmthrs(const TMC_AxisEnum axis, const uint32_t thrs) { _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" stealthChop max speed set to ", thrs); + SERIAL_ECHOLNPAIR(" stealthChop max speed: ", thrs); } void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { _tmc_say_axis(axis); - SERIAL_ECHOPGM(" driver homing sensitivity set to "); + SERIAL_ECHOPGM(" homing sensitivity: "); SERIAL_PRINTLN(sgt, DEC); } @@ -312,7 +312,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { #if ENABLED(HAVE_TMC2130) static void tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { - switch(i) { + switch (i) { case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; case TMC_TSTEP: SERIAL_ECHO(st.TSTEP()); break; case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; @@ -321,7 +321,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { } } static void tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) { - switch(i) { + switch (i) { case TMC_STALLGUARD: if (st.stallguard()) SERIAL_CHAR('X'); break; case TMC_SG_RESULT: SERIAL_PRINT(st.sg_result(), DEC); break; case TMC_FSACTIVE: if (st.fsactive()) SERIAL_CHAR('X'); break; @@ -331,7 +331,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { #endif #if ENABLED(HAVE_TMC2208) static void tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { - switch(i) { + switch (i) { case TMC_TSTEP: { uint32_t data = 0; st.TSTEP(&data); SERIAL_PROTOCOL(data); break; } case TMC_PWM_SCALE: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break; case TMC_STEALTHCHOP: serialprintPGM(st.stealth() ? PSTR("true") : PSTR("false")); break; @@ -341,7 +341,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { } } static void tmc_parse_drv_status(TMC2208Stepper &st, const TMC_drv_status_enum i) { - switch(i) { + switch (i) { case TMC_T157: if (st.t157()) SERIAL_CHAR('X'); break; case TMC_T150: if (st.t150()) SERIAL_CHAR('X'); break; case TMC_T143: if (st.t143()) SERIAL_CHAR('X'); break; @@ -354,7 +354,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { template static void tmc_status(TMC &st, const TMC_AxisEnum axis, const TMC_debug_enum i, const float spmm) { SERIAL_ECHO('\t'); - switch(i) { + switch (i) { case TMC_CODES: _tmc_say_axis(axis); break; case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break; case TMC_CURRENT: SERIAL_ECHO(st.getCurrent()); break; @@ -383,7 +383,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { break; case TMC_TPWMTHRS_MMS: { uint32_t tpwmthrs_val = st.TPWMTHRS(); - tpwmthrs_val ? SERIAL_ECHO(12650000UL * st.microsteps() / (256 * tpwmthrs_val * spmm)) : SERIAL_CHAR('-'); + tpwmthrs_val ? SERIAL_ECHO(12650000UL * st.microsteps() / (256 * tpwmthrs_val * spmm)) : (void)SERIAL_CHAR('-'); } break; case TMC_OTPW: serialprintPGM(st.otpw() ? PSTR("true") : PSTR("false")); break; @@ -399,7 +399,7 @@ void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { template static void tmc_parse_drv_status(TMC &st, const TMC_AxisEnum axis, const TMC_drv_status_enum i) { SERIAL_CHAR('\t'); - switch(i) { + switch (i) { case TMC_DRV_CODES: _tmc_say_axis(axis); break; case TMC_STST: if (st.stst()) SERIAL_CHAR('X'); break; case TMC_OLB: if (st.olb()) SERIAL_CHAR('X'); break;