Karl Andersson
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
1 deletions
-
Marlin/src/feature/tmc_util.cpp
|
@ -1096,8 +1096,11 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool tmc_enable_stallguard(TMC2209Stepper &st) { |
|
|
bool tmc_enable_stallguard(TMC2209Stepper &st) { |
|
|
|
|
|
const bool stealthchop_was_enabled = !st.en_spreadCycle(); |
|
|
|
|
|
|
|
|
st.TCOOLTHRS(0xFFFFF); |
|
|
st.TCOOLTHRS(0xFFFFF); |
|
|
return !st.en_spreadCycle(); |
|
|
st.en_spreadCycle(false); |
|
|
|
|
|
return stealthchop_was_enabled; |
|
|
} |
|
|
} |
|
|
void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) { |
|
|
void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) { |
|
|
st.en_spreadCycle(!restore_stealth); |
|
|
st.en_spreadCycle(!restore_stealth); |
|
|