More concise tmc_util output, fix a ternary type

This commit is contained in:
Scott Lahteine 2018-03-14 04:10:24 -05:00
parent bba2a3b906
commit 07b1ac06a9

View File

@ -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);
}
@ -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;