From 99d7af87fd7cd74b9a6eab355eb71327ed3b8256 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 28 Nov 2023 12:49:53 -0500 Subject: [PATCH] pwm_tool: Notify the toolhead that the move_queue needs to be flushed Call toolhead.note_kinematic_activity() on each pin update to ensure that those updates will be flushed properly. This fixes "Timer too close" errors on SET_PIN commands that are issued when the toolhead is idle. Signed-off-by: Kevin O'Connor --- klippy/extras/pwm_tool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/klippy/extras/pwm_tool.py b/klippy/extras/pwm_tool.py index c012bb31..e3a7377c 100644 --- a/klippy/extras/pwm_tool.py +++ b/klippy/extras/pwm_tool.py @@ -143,6 +143,8 @@ class PrinterOutputPin: self.mcu_pin.set_pwm(print_time, value) self.last_value = value self.last_print_time = print_time + toolhead = self.printer.lookup_object('toolhead') + toolhead.note_kinematic_activity(print_time) cmd_SET_PIN_help = "Set the value of an output pin" def cmd_SET_PIN(self, gcmd): # Read requested value