Clean up M122 code

This commit is contained in:
Scott Lahteine 2020-05-02 15:39:23 -05:00
parent dcd02284be
commit 9b7807d40f

View File

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