From fbbbbc85cf6b717a48c9c62cd39a219af0223655 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 19 Feb 2020 11:38:11 -0500 Subject: 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 --- klippy/toolhead.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'klippy/toolhead.py') 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: -- cgit v1.2.3-70-g09d2