From 3276320a062554b161df9e060dbbc1fcb70c4eaf Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 5 Apr 2021 20:07:03 +0200 Subject: [PATCH] Hide tmc2130_sg_change behind DEBUG_CRASHDET_COUNTERS tmc2130_sg_change is only used for debugging purposes. Hide definition and usage behind the required define. --- Firmware/tmc2130.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Firmware/tmc2130.cpp b/Firmware/tmc2130.cpp index 3f6826908..480efb2ba 100755 --- a/Firmware/tmc2130.cpp +++ b/Firmware/tmc2130.cpp @@ -68,8 +68,9 @@ uint8_t tmc2130_sg_diag_mask = 0x00; uint8_t tmc2130_sg_crash = 0; uint16_t tmc2130_sg_err[4] = {0, 0, 0, 0}; uint16_t tmc2130_sg_cnt[4] = {0, 0, 0, 0}; +#ifdef DEBUG_CRASHDET_COUNTERS bool tmc2130_sg_change = false; - +#endif bool skip_debug_msg = false; @@ -255,7 +256,9 @@ void tmc2130_st_isr() if (tmc2130_sg_cnt[axis] < tmc2130_sg_err[axis]) { tmc2130_sg_cnt[axis] = tmc2130_sg_err[axis]; +#ifdef DEBUG_CRASHDET_COUNTERS tmc2130_sg_change = true; +#endif uint8_t sg_thr = 64; // if (axis == Y_AXIS) sg_thr = 64; if (tmc2130_sg_err[axis] >= sg_thr) @@ -409,7 +412,9 @@ void tmc2130_check_overtemp() } checktime = _millis(); +#ifdef DEBUG_CRASHDET_COUNTERS tmc2130_sg_change = true; +#endif } #ifdef DEBUG_CRASHDET_COUNTERS if (tmc2130_sg_change)