Skip to content

Commit

Permalink
pwm_tool: Notify the toolhead that the move_queue needs to be flushed
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
KevinOConnor committed Dec 7, 2023
1 parent c491ea6 commit 99d7af8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions klippy/extras/pwm_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def _set_pin(self, print_time, value):
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
Expand Down

0 comments on commit 99d7af8

Please sign in to comment.