Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockable_probe: fix bug generating config #133

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading