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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user