Skip to content

Commit

Permalink
Fix TMC220x short circuit (MarlinFirmware#20731)
Browse files Browse the repository at this point in the history
  • Loading branch information
devin122 authored and W4tel-BiDi committed Apr 5, 2021
1 parent fd0121f commit 70937f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/feature/tmc_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 70937f9

Please sign in to comment.