Skip to content

Commit

Permalink
dockable_probe: fix bug generating config (Klipper3d#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerlz authored Jan 26, 2024
1 parent d8faa86 commit db7be1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions klippy/extras/dockable_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ def __init__(self, config):
pin = config.get("pin")
pin_params = ppins.lookup_pin(pin, can_invert=True, can_pullup=True)
mcu = pin_params["chip"]
mcu.register_config_callback(self._build_config)
self.mcu_endstop = mcu.setup_pin("endstop", pin_params)

# Wrappers
Expand Down Expand Up @@ -283,6 +282,10 @@ def __init__(self, config):
"klippy:connect", self._handle_connect
)

self.printer.register_event_handler(
"klippy:mcu_identify", self._handle_config
)

# Parse a string coordinate representation from the config
# and return a list of numbers.
#
Expand All @@ -307,7 +310,7 @@ def _parse_coord(self, config, name, expected_dims=3):
p[:supplied_dims] = vals
return p

def _build_config(self):
def _handle_config(self):
kin = self.printer.lookup_object("toolhead").get_kinematics()
for stepper in kin.get_steppers():
if stepper.is_active_axis("z"):
Expand Down
2 changes: 1 addition & 1 deletion klippy/extras/homing.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def home_rails(self, rails, forcepos, movepos):

# Perform second home
if retract_dist:
logging.info("needs rehome: %s", needs_rehome)
logging.info("homing:needs rehome: %s", needs_rehome)
# Retract
startpos = self._fill_coord(forcepos)
homepos = self._fill_coord(movepos)
Expand Down

0 comments on commit db7be1a

Please sign in to comment.