diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-09-15 00:03:58 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-09-16 13:31:14 -0400 |
commit | 69e0d866c02a93072ea6aeaaec230b6939ba7604 (patch) | |
tree | 8b34790d7e06f2649d462bcc0d52d703aeba1ec7 /klippy/extras/servo.py | |
parent | 0532a41c752df66f149cf55d779072f420ee1b6a (diff) | |
download | kutter-69e0d866c02a93072ea6aeaaec230b6939ba7604.tar.gz kutter-69e0d866c02a93072ea6aeaaec230b6939ba7604.tar.xz kutter-69e0d866c02a93072ea6aeaaec230b6939ba7604.zip |
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>
Diffstat (limited to 'klippy/extras/servo.py')
-rw-r--r-- | klippy/extras/servo.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/klippy/extras/servo.py b/klippy/extras/servo.py index 10537e67..f1ce9976 100644 --- a/klippy/extras/servo.py +++ b/klippy/extras/servo.py @@ -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 |