Browse Source

Fix TMC220x short circuit (#20731)

vanilla_fb_2.0.x
devin122 4 years ago
committed by Scott Lahteine
parent
commit
8eb32cef24
  1. 4
      Marlin/src/feature/tmc_util.cpp

4
Marlin/src/feature/tmc_util.cpp

@ -147,7 +147,7 @@
static TMC_driver_data get_driver_data(TMC2208Stepper &st) { static TMC_driver_data get_driver_data(TMC2208Stepper &st) {
constexpr uint8_t OTPW_bp = 0, OT_bp = 1; constexpr uint8_t OTPW_bp = 0, OT_bp = 1;
constexpr uint8_t S2G_bm = 0b11110; // 2..5 constexpr uint8_t S2G_bm = 0b111100; // 2..5
TMC_driver_data data; TMC_driver_data data;
const auto ds = data.drv_status = st.DRV_STATUS(); const auto ds = data.drv_status = st.DRV_STATUS();
data.is_otpw = TEST(ds, OTPW_bp); data.is_otpw = TEST(ds, OTPW_bp);
@ -291,7 +291,7 @@
bool should_step_down = false; bool should_step_down = false;
if (need_update_error_counters) { if (need_update_error_counters) {
if (data.is_ot /* | data.s2ga | data.s2gb*/) st.error_count++; if (data.is_ot | data.is_s2g) st.error_count++;
else if (st.error_count > 0) st.error_count--; else if (st.error_count > 0) st.error_count--;
#if ENABLED(STOP_ON_ERROR) #if ENABLED(STOP_ON_ERROR)

Loading…
Cancel
Save