aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-03-26 11:31:30 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-03-26 11:33:05 -0400
commit861144d8845bb6ea43591d8e2c10c342fef5596c (patch)
tree9aec4d602c3313b7bccf7218df6bf404310e6775
parent88f6061cd7232e883848e78d8b3cf5a2488babef (diff)
downloadkutter-861144d8845bb6ea43591d8e2c10c342fef5596c.tar.gz
kutter-861144d8845bb6ea43591d8e2c10c342fef5596c.tar.xz
kutter-861144d8845bb6ea43591d8e2c10c342fef5596c.zip
output_pin: Increase time host has to confirm a pin setting
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/extras/output_pin.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/klippy/extras/output_pin.py b/klippy/extras/output_pin.py
index d2b1a079..74e5c1b1 100644
--- a/klippy/extras/output_pin.py
+++ b/klippy/extras/output_pin.py
@@ -5,6 +5,7 @@
# This file may be distributed under the terms of the GNU GPLv3 license.
PIN_MIN_TIME = 0.100
+RESEND_HOST_TIME = 0.300 + PIN_MIN_TIME
class PrinterOutputPin:
def __init__(self, config):
@@ -27,17 +28,17 @@ class PrinterOutputPin:
minval=0., maxval=self.scale)
self.reactor = self.printer.get_reactor()
self.resend_timer = None
- self.resend_interval = 0
+ self.resend_interval = 0.
if static_value is not None:
self.mcu_pin.setup_max_duration(0.)
self.last_value = static_value / self.scale
self.mcu_pin.setup_start_value(
self.last_value, self.last_value, True)
else:
- self.max_mcu_duration = config.getfloat('maximum_mcu_duration',
- 0, minval=0.500)
- self.mcu_pin.setup_max_duration(self.max_mcu_duration)
- self.resend_interval = .8 * self.max_mcu_duration - PIN_MIN_TIME
+ max_mcu_duration = config.getfloat('maximum_mcu_duration',
+ 0., minval=0.500)
+ self.mcu_pin.setup_max_duration(max_mcu_duration)
+ self.resend_interval = max_mcu_duration - RESEND_HOST_TIME
self.last_value = config.getfloat(
'value', 0., minval=0., maxval=self.scale) / self.scale
@@ -63,7 +64,7 @@ class PrinterOutputPin:
self.last_value = value
self.last_cycle_time = cycle_time
self.last_print_time = print_time
- if self.max_mcu_duration != 0 and self.resend_timer is None:
+ if self.resend_interval and self.resend_timer is None:
self.resend_timer = self.reactor.register_timer(
self._resend_current_val, self.reactor.NOW)
cmd_SET_PIN_help = "Set the value of an output pin"