Skip to content

Commit

Permalink
oop
Browse files Browse the repository at this point in the history
  • Loading branch information
bwnance committed Jan 8, 2024
1 parent 6b40ecd commit 18fa7bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions klippy/extras/homing.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def _set_current_homing(self, homing_axes):
if dwell_time is None:
dwell_time = ch.current_change_dwell_time
ch.set_current_for_homing(print_time)
self.toolhead.dwell(dwell_time)
if dwell_time:
self.toolhead.dwell(dwell_time)

def _set_current_post_homing(self, homing_axes):
print_time = self.toolhead.get_last_move_time()
Expand All @@ -280,12 +281,12 @@ def _set_current_post_homing(self, homing_axes):
chs = rail.get_tmc_current_helpers()
dwell_time = None
for ch in chs:
print("current helping")
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)
self.toolhead.dwell(dwell_time)
if dwell_time:
self.toolhead.dwell(dwell_time)

def home_rails(self, rails, forcepos, movepos):
# Notify of upcoming homing operation
Expand Down
8 changes: 5 additions & 3 deletions klippy/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,7 @@ def __init__(
self.endstop_map = {}
self.add_extra_stepper(config)
mcu_stepper = self.steppers[0]
self._tmc_current_helpers = [
s.get_tmc_current_helper() for s in self.steppers
]
self._tmc_current_helpers = None
self.get_name = mcu_stepper.get_name
self.get_commanded_position = mcu_stepper.get_commanded_position
self.calc_position_from_coord = mcu_stepper.calc_position_from_coord
Expand Down Expand Up @@ -485,6 +483,10 @@ def __init__(
)

def get_tmc_current_helpers(self):
if self._tmc_current_helpers is None:
self._tmc_current_helpers = [
s.get_tmc_current_helper() for s in self.steppers
]
return self._tmc_current_helpers

def get_range(self):
Expand Down

0 comments on commit 18fa7bb

Please sign in to comment.