mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-07 05:54:05 -06:00
tmc: Track requested hold_current so SET_TMC_CURRENT doesn't reduce it
The code automatically reduces the hold_current so that it is no greater than the run_current. However, this could lead to confusing behavior if one reduced and then increased the run_current via SET_TMC_CURRENT commands. To avoid that, this change adds support for tracking the requested hold_current - thus changes to run_current don't subtly alter the hold_current. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
627c1c5d2a
commit
86fee2d517
5 changed files with 20 additions and 17 deletions
|
@ -169,7 +169,7 @@ class TMC2660CurrentHelper:
|
|||
self.mcu_tmc.set_register("DRVCONF", val, print_time)
|
||||
|
||||
def get_current(self):
|
||||
return self.current, None, MAX_CURRENT
|
||||
return self.current, None, None, MAX_CURRENT
|
||||
|
||||
def set_current(self, run_current, hold_current, print_time):
|
||||
self.current = run_current
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue