mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-23 06:33:59 -06:00
output_pin: Improve GCodeRequestQueue timing on duplicate requests
If there is a duplicate request it is not necessary to add a 100ms delay to the next update. Rework the callback signaling to better report these duplicate updates. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
0532a41c75
commit
69e0d866c0
2 changed files with 23 additions and 17 deletions
|
@ -45,10 +45,10 @@ class PrinterServo:
|
|||
def get_status(self, eventtime):
|
||||
return {'value': self.last_value}
|
||||
def _set_pwm(self, print_time, value):
|
||||
if value != self.last_value:
|
||||
self.last_value = value
|
||||
self.mcu_servo.set_pwm(print_time, value)
|
||||
return (True, 0.)
|
||||
if value == self.last_value:
|
||||
return "discard", 0.
|
||||
self.last_value = value
|
||||
self.mcu_servo.set_pwm(print_time, value)
|
||||
def _get_pwm_from_angle(self, angle):
|
||||
angle = max(0., min(self.max_angle, angle))
|
||||
width = self.min_width + angle * self.angle_to_width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue