diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-08-16 14:05:13 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-09-12 13:24:29 -0400 |
commit | 3a57f71f33edb0bc60ee49079d723891b2072552 (patch) | |
tree | b4c2ae713275b6a3ea69dfa6953bb7fe3e752ccd /klippy | |
parent | 293858c51fc51c998a046ba12c00da0418fb8403 (diff) | |
download | kutter-3a57f71f33edb0bc60ee49079d723891b2072552.tar.gz kutter-3a57f71f33edb0bc60ee49079d723891b2072552.tar.xz kutter-3a57f71f33edb0bc60ee49079d723891b2072552.zip |
output_pin: Remove deprecated maximum_mcu_duration and static_value
Remove support for these two config options that were previously
deprecated.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/extras/output_pin.py | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/klippy/extras/output_pin.py b/klippy/extras/output_pin.py index ef094674..993d2622 100644 --- a/klippy/extras/output_pin.py +++ b/klippy/extras/output_pin.py @@ -5,7 +5,6 @@ # 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 MAX_SCHEDULE_TIME = 5.0 class PrinterOutputPin: @@ -24,29 +23,13 @@ class PrinterOutputPin: else: self.mcu_pin = ppins.setup_pin('digital_out', config.get('pin')) self.scale = 1. + self.mcu_pin.setup_max_duration(0.) self.last_print_time = 0. - # Support mcu checking for maximum duration - self.reactor = self.printer.get_reactor() - self.resend_timer = None - self.resend_interval = 0. - max_mcu_duration = config.getfloat('maximum_mcu_duration', 0., - minval=0.500, - maxval=MAX_SCHEDULE_TIME) - self.mcu_pin.setup_max_duration(max_mcu_duration) - if max_mcu_duration: - config.deprecate('maximum_mcu_duration') - self.resend_interval = max_mcu_duration - RESEND_HOST_TIME # Determine start and shutdown values - static_value = config.getfloat('static_value', None, - minval=0., maxval=self.scale) - if static_value is not None: - config.deprecate('static_value') - self.last_value = self.shutdown_value = static_value / self.scale - else: - self.last_value = config.getfloat( - 'value', 0., minval=0., maxval=self.scale) / self.scale - self.shutdown_value = config.getfloat( - 'shutdown_value', 0., minval=0., maxval=self.scale) / self.scale + self.last_value = config.getfloat( + 'value', 0., minval=0., maxval=self.scale) / self.scale + self.shutdown_value = config.getfloat( + 'shutdown_value', 0., minval=0., maxval=self.scale) / self.scale self.mcu_pin.setup_start_value(self.last_value, self.shutdown_value) # Register commands pin_name = config.get_name().split()[1] @@ -56,8 +39,8 @@ class PrinterOutputPin: desc=self.cmd_SET_PIN_help) def get_status(self, eventtime): return {'value': self.last_value} - def _set_pin(self, print_time, value, is_resend=False): - if value == self.last_value and not is_resend: + def _set_pin(self, print_time, value): + if value == self.last_value: return print_time = max(print_time, self.last_print_time + PIN_MIN_TIME) if self.is_pwm: @@ -66,9 +49,6 @@ class PrinterOutputPin: self.mcu_pin.set_digital(print_time, value) self.last_value = value self.last_print_time = print_time - 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" def cmd_SET_PIN(self, gcmd): # Read requested value @@ -81,20 +61,5 @@ class PrinterOutputPin: toolhead.register_lookahead_callback( lambda print_time: self._set_pin(print_time, value)) - def _resend_current_val(self, eventtime): - if self.last_value == self.shutdown_value: - self.reactor.unregister_timer(self.resend_timer) - self.resend_timer = None - return self.reactor.NEVER - - systime = self.reactor.monotonic() - print_time = self.mcu_pin.get_mcu().estimated_print_time(systime) - time_diff = (self.last_print_time + self.resend_interval) - print_time - if time_diff > 0.: - # Reschedule for resend time - return systime + time_diff - self._set_pin(print_time + PIN_MIN_TIME, self.last_value, True) - return systime + self.resend_interval - def load_config_prefix(config): return PrinterOutputPin(config) |