Apply TERN to compact code (#17619)
This commit is contained in:
@@ -63,9 +63,9 @@
|
||||
, is_stall:1
|
||||
, is_stealth:1
|
||||
, is_standstill:1
|
||||
#if HAS_STALLGUARD
|
||||
, sg_result_reasonable:1
|
||||
#endif
|
||||
#if HAS_STALLGUARD
|
||||
, sg_result_reasonable:1
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
@@ -169,9 +169,7 @@
|
||||
data.is_stealth = TEST(ds, STEALTH_bp);
|
||||
data.is_standstill = TEST(ds, STST_bp);
|
||||
#endif
|
||||
#if HAS_STALLGUARD
|
||||
data.sg_result_reasonable = false;
|
||||
#endif
|
||||
TERN_(HAS_STALLGUARD, data.sg_result_reasonable = false);
|
||||
#endif
|
||||
return data;
|
||||
}
|
||||
@@ -213,9 +211,7 @@
|
||||
SERIAL_PRINTLN(data.drv_status, HEX);
|
||||
if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
|
||||
if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit");
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
tmc_report_all(true, true, true, true);
|
||||
#endif
|
||||
TERN_(TMC_DEBUG, tmc_report_all(true, true, true, true));
|
||||
kill(PSTR("Driver error"));
|
||||
}
|
||||
#endif
|
||||
@@ -446,9 +442,7 @@
|
||||
(void)monitor_tmc_driver(stepperE7, need_update_error_counters, need_debug_reporting);
|
||||
#endif
|
||||
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
if (need_debug_reporting) SERIAL_EOL();
|
||||
#endif
|
||||
if (TERN0(TMC_DEBUG, need_debug_reporting)) SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user