TMC_DEBUG optimization and improvements (#13135)

This commit is contained in:
LinFor
2019-02-20 11:22:42 +03:00
committed by Scott Lahteine
parent 1424b368cf
commit ba39186364
7 changed files with 240 additions and 122 deletions

View File

@ -65,7 +65,7 @@ void GcodeSuite::M122() {
#define L6470_SAY_STATUS(Q) L6470_status_decode(stepper##Q.getStatus(), Q)
//if (parser.seen('S'))
// tmc_set_report_status(parser.value_bool());
// tmc_set_report_interval(parser.value_bool());
//else
#if AXIS_DRIVER_TYPE_X(L6470)

View File

@ -39,8 +39,9 @@ void GcodeSuite::M122() {
#if ENABLED(TMC_DEBUG)
#if ENABLED(MONITOR_DRIVER_STATUS)
if (parser.seen('S'))
tmc_set_report_status(parser.value_bool());
const bool sflag = parser.seen('S'), s0 = sflag && !parser.value_bool();
if (sflag) tmc_set_report_interval(s0 ? 0 : MONITOR_DRIVER_STATUS_INTERVAL_MS);
if (!s0 && parser.seenval('P')) tmc_set_report_interval(MIN(parser.value_ushort(), MONITOR_DRIVER_STATUS_INTERVAL_MS));
#endif
if (parser.seen('V'))

View File

@ -662,7 +662,7 @@ void GcodeSuite::process_parsed_command(
#endif
#if HAS_TRINAMIC
case 122: M122(); break;
case 122: M122(); break; // M122: Report driver configuration and status
case 906: M906(); break; // M906: Set motor current in milliamps using axis codes X, Y, Z, E
#if HAS_STEALTHCHOP
case 569: M569(); break; // M569: Enable stealthChop on an axis.