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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2023-11-28 12:49:53 -05:00
parent c491ea669f
commit 99d7af87fd
1 changed files with 2 additions and 0 deletions

View File

@ -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