From 7f793c6f8f67149bd5c5b5b0933bfe2c7875d938 Mon Sep 17 00:00:00 2001 From: Rogerio Goncalves Date: Fri, 10 May 2024 19:49:22 +0100 Subject: [PATCH] Revert "bugfix: restore run_current after sensorless homing (#233)" (#235) This reverts commit a47811645e1ead5317c00c9f7bd38ae4307ea78e. --- klippy/extras/homing.py | 2 +- klippy/extras/tmc2130.py | 5 +---- klippy/extras/tmc2240.py | 5 +---- klippy/extras/tmc2660.py | 3 --- klippy/extras/tmc5160.py | 5 +---- 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/klippy/extras/homing.py b/klippy/extras/homing.py index 56b4cb84d..2dff044c6 100644 --- a/klippy/extras/homing.py +++ b/klippy/extras/homing.py @@ -281,7 +281,7 @@ def _set_current_post_homing(self, homing_axes): chs = rail.get_tmc_current_helpers() dwell_time = None for ch in chs: - if ch is not None and ch.needs_run_current_change(): + if ch is not None and ch.needs_home_current_change(): if dwell_time is None: dwell_time = ch.current_change_dwell_time ch.set_current_for_normal(print_time) diff --git a/klippy/extras/tmc2130.py b/klippy/extras/tmc2130.py index b34680b6f..95df2ee85 100644 --- a/klippy/extras/tmc2130.py +++ b/klippy/extras/tmc2130.py @@ -230,9 +230,6 @@ def __init__(self, config, mcu_tmc): def needs_home_current_change(self): return self._home_current != self.run_current - def needs_run_current_change(self): - return self._prev_current != self.run_current - def set_home_current(self, new_home_current): self._home_current = min(MAX_CURRENT, new_home_current) @@ -284,7 +281,7 @@ def get_current(self): def set_current(self, run_current, hold_current, print_time, force=False): if ( - run_current == self.run_current + run_current == self._prev_current and hold_current == self.req_hold_current and not force ): diff --git a/klippy/extras/tmc2240.py b/klippy/extras/tmc2240.py index 2fe209844..23fc71408 100644 --- a/klippy/extras/tmc2240.py +++ b/klippy/extras/tmc2240.py @@ -300,9 +300,6 @@ def __init__(self, config, mcu_tmc): def needs_home_current_change(self): return self._home_current != self.run_current - def needs_run_current_change(self): - return self._prev_current != self.run_current - def set_home_current(self, new_home_current): self._home_current = min(self.max_cur, new_home_current) @@ -363,7 +360,7 @@ def get_current(self): def set_current(self, run_current, hold_current, print_time, force=False): if ( - run_current == self.run_current + run_current == self._prev_current and hold_current == self.req_hold_current and not force ): diff --git a/klippy/extras/tmc2660.py b/klippy/extras/tmc2660.py index 64021f8c2..fc334ea24 100644 --- a/klippy/extras/tmc2660.py +++ b/klippy/extras/tmc2660.py @@ -150,9 +150,6 @@ def __init__(self, config, mcu_tmc): def needs_home_current_change(self): return self._home_current != self.current - def needs_run_current_change(self): - return self._prev_current != self.current - def set_home_current(self, new_home_current): self._home_current = min(MAX_CURRENT, new_home_current) diff --git a/klippy/extras/tmc5160.py b/klippy/extras/tmc5160.py index b00b992bd..54c081ad9 100644 --- a/klippy/extras/tmc5160.py +++ b/klippy/extras/tmc5160.py @@ -283,9 +283,6 @@ def __init__(self, config, mcu_tmc): def needs_home_current_change(self): return self._home_current != self.run_current - def needs_run_current_change(self): - return self._prev_current != self.run_current - def set_home_current(self, new_home_current): self._home_current = min(MAX_CURRENT, new_home_current) @@ -341,7 +338,7 @@ def get_current(self): def set_current(self, run_current, hold_current, print_time, force=False): if ( - run_current == self.run_current + run_current == self._prev_current and hold_current == self.req_hold_current and not force ):