Skip to content

Commit 765720e

Browse files
committed
♻️ Simplify TMC utilities for more axes
1 parent 26a2443 commit 765720e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Marlin/src/MarlinCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ void setup() {
14881488
#endif
14891489

14901490
#if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
1491-
SETUP_RUN(test_tmc_connection(true, true, true, true));
1491+
SETUP_RUN(test_tmc_connection());
14921492
#endif
14931493

14941494
#if HAS_DRIVER_SAFE_POWER_PROTECT

Marlin/src/feature/tmc_util.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
SERIAL_PRINTLN(data.drv_status, HEX);
212212
if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
213213
if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit");
214-
TERN_(TMC_DEBUG, tmc_report_all(true, true, true, true));
214+
TERN_(TMC_DEBUG, tmc_report_all());
215215
kill(PSTR("Driver error"));
216216
}
217217
#endif
@@ -889,7 +889,7 @@
889889
* M122 report functions
890890
*/
891891

892-
void tmc_report_all(bool print_x, const bool print_y, const bool print_z, const bool print_e) {
892+
void tmc_report_all(const bool print_x/*=true*/, const bool print_y/*=true*/, const bool print_z/*=true*/, const bool print_e/*=true*/) {
893893
#define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_debug_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
894894
#define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
895895
TMC_REPORT("\t", TMC_CODES);
@@ -1214,7 +1214,7 @@ static bool test_connection(TMC &st) {
12141214
return test_result;
12151215
}
12161216

1217-
void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z, const bool test_e) {
1217+
void test_tmc_connection(const bool test_x/*=true*/, const bool test_y/*=true*/, const bool test_z/*=true*/, const bool test_e/*=true*/) {
12181218
uint8_t axis_connection = 0;
12191219

12201220
if (test_x) {

Marlin/src/feature/tmc_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ void tmc_print_current(TMC &st) {
341341
#endif
342342

343343
void monitor_tmc_drivers();
344-
void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z, const bool test_e);
344+
void test_tmc_connection(const bool test_x=true, const bool test_y=true, const bool test_z=true, const bool test_e=true);
345345

346346
#if ENABLED(TMC_DEBUG)
347347
#if ENABLED(MONITOR_DRIVER_STATUS)
348348
void tmc_set_report_interval(const uint16_t update_interval);
349349
#endif
350-
void tmc_report_all(const bool print_x, const bool print_y, const bool print_z, const bool print_e);
350+
void tmc_report_all(const bool print_x=true, const bool print_y=true, const bool print_z=true, const bool print_e=true);
351351
void tmc_get_registers(const bool print_x, const bool print_y, const bool print_z, const bool print_e);
352352
#endif
353353

0 commit comments

Comments
 (0)