Fix TMC220x short circuit (#20731)

This commit is contained in:
devin122 2021-01-11 02:46:17 -05:00 committed by GitHub
parent 4327b5c1b0
commit 8ff87c120a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,7 +147,7 @@
static TMC_driver_data get_driver_data(TMC2208Stepper &st) {
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;
const auto ds = data.drv_status = st.DRV_STATUS();
data.is_otpw = TEST(ds, OTPW_bp);
@ -291,7 +291,7 @@
bool should_step_down = false;
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--;
#if ENABLED(STOP_ON_ERROR)