From 86fee2d517861546c7ba78cc1b59b83c2738ace4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 24 Oct 2021 20:03:42 -0400 Subject: 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 --- klippy/extras/tmc2660.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'klippy/extras/tmc2660.py') diff --git a/klippy/extras/tmc2660.py b/klippy/extras/tmc2660.py index 52aa2e42..f55f6f01 100644 --- a/klippy/extras/tmc2660.py +++ b/klippy/extras/tmc2660.py @@ -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 -- cgit v1.2.3-70-g09d2