diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-02-19 11:38:11 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-02-19 11:45:44 -0500 |
commit | fbbbbc85cf6b717a48c9c62cd39a219af0223655 (patch) | |
tree | 270938f67869f4bf23e193c30cc4f991c4a0227b /klippy/toolhead.py | |
parent | e3a5e2d271d1ead9112654bc19d631aa2cb944ee (diff) | |
download | kutter-fbbbbc85cf6b717a48c9c62cd39a219af0223655.tar.gz kutter-fbbbbc85cf6b717a48c9c62cd39a219af0223655.tar.xz kutter-fbbbbc85cf6b717a48c9c62cd39a219af0223655.zip |
homing: Replace notify callback with a completion
Update the endstop code to return its trigger completion object during
home_start(). Update the toolhead class to take a completion object
(instead of creating its own). This reduces the number of
intermediate callbacks needed during a homing operation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r-- | klippy/toolhead.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 85e4be53..c7c9f35a 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -441,7 +441,7 @@ class ToolHead: continue npt = min(self.print_time + DRIP_SEGMENT_TIME, next_print_time) self._update_move_time(npt) - def drip_move(self, newpos, speed): + def drip_move(self, newpos, speed, drip_completion): # Transition from "Flushed"/"Priming"/main state to "Drip" state self.move_queue.flush() self.special_queuing_state = "Drip" @@ -449,7 +449,7 @@ class ToolHead: self.reactor.update_timer(self.flush_timer, self.reactor.NEVER) self.move_queue.set_flush_time(self.buffer_time_high) self.idle_flush_print_time = 0. - self.drip_completion = self.reactor.completion() + self.drip_completion = drip_completion # Submit move try: self.move(newpos, speed) @@ -464,8 +464,6 @@ class ToolHead: self.trapq_free_moves(self.trapq, self.reactor.NEVER) # Exit "Drip" state self.flush_step_generation() - def signal_drip_mode_end(self): - self.drip_completion.complete(True) # Misc commands def stats(self, eventtime): for m in self.all_mcus: |