Browse Source

♻️ Simplify TMC utilities for more axes

Scott Lahteine 4 years ago
parent
commit
926a7f27c6
3 changed files with 6 additions and 6 deletions
  1. 1
    1
      Marlin/src/MarlinCore.cpp
  2. 3
    3
      Marlin/src/feature/tmc_util.cpp
  3. 2
    2
      Marlin/src/feature/tmc_util.h

+ 1
- 1
Marlin/src/MarlinCore.cpp View File

1488
   #endif
1488
   #endif
1489
 
1489
 
1490
   #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
1490
   #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
1491
-    SETUP_RUN(test_tmc_connection(true, true, true, true));
1491
+    SETUP_RUN(test_tmc_connection());
1492
   #endif
1492
   #endif
1493
 
1493
 
1494
   #if HAS_DRIVER_SAFE_POWER_PROTECT
1494
   #if HAS_DRIVER_SAFE_POWER_PROTECT

+ 3
- 3
Marlin/src/feature/tmc_util.cpp View File

211
       SERIAL_PRINTLN(data.drv_status, HEX);
211
       SERIAL_PRINTLN(data.drv_status, HEX);
212
       if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
212
       if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
213
       if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit");
213
       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());
215
       kill(PSTR("Driver error"));
215
       kill(PSTR("Driver error"));
216
     }
216
     }
217
   #endif
217
   #endif
889
    * M122 report functions
889
    * M122 report functions
890
    */
890
    */
891
 
891
 
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*/) {
893
     #define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL);  tmc_debug_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
893
     #define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL);  tmc_debug_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
894
     #define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
894
     #define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
895
     TMC_REPORT("\t",                 TMC_CODES);
895
     TMC_REPORT("\t",                 TMC_CODES);
1214
   return test_result;
1214
   return test_result;
1215
 }
1215
 }
1216
 
1216
 
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*/) {
1218
   uint8_t axis_connection = 0;
1218
   uint8_t axis_connection = 0;
1219
 
1219
 
1220
   if (test_x) {
1220
   if (test_x) {

+ 2
- 2
Marlin/src/feature/tmc_util.h View File

341
 #endif
341
 #endif
342
 
342
 
343
 void monitor_tmc_drivers();
343
 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);
345
 
345
 
346
 #if ENABLED(TMC_DEBUG)
346
 #if ENABLED(TMC_DEBUG)
347
   #if ENABLED(MONITOR_DRIVER_STATUS)
347
   #if ENABLED(MONITOR_DRIVER_STATUS)
348
     void tmc_set_report_interval(const uint16_t update_interval);
348
     void tmc_set_report_interval(const uint16_t update_interval);
349
   #endif
349
   #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);
351
   void tmc_get_registers(const bool print_x, const bool print_y, const bool print_z, const bool print_e);
351
   void tmc_get_registers(const bool print_x, const bool print_y, const bool print_z, const bool print_e);
352
 #endif
352
 #endif
353
 
353
 

Loading…
Cancel
Save