diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2023-01-13 10:18:18 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-01-23 20:04:03 -0500 |
commit | 7abafb575ba7b098b9f1025a1d65717568a89876 (patch) | |
tree | cd62c69ede5d46178cbbccfbb648580c8ad3c338 /klippy/extras/sx1509.py | |
parent | 4115ea128af3308c1a5af224fce83b12c2e97e1a (diff) | |
download | kutter-7abafb575ba7b098b9f1025a1d65717568a89876.tar.gz kutter-7abafb575ba7b098b9f1025a1d65717568a89876.tar.xz kutter-7abafb575ba7b098b9f1025a1d65717568a89876.zip |
mcu: Remove support for "static" pins
Update static_digital_output.py to directly configure static digital
pins. There are no other users of "static" pins, so remove that
support from mcu.py, replicape.py, and sx1509.py. This simplifies the
low-level pin handling code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/sx1509.py')
-rw-r--r-- | klippy/extras/sx1509.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/klippy/extras/sx1509.py b/klippy/extras/sx1509.py index 8b19dda8..51080fe2 100644 --- a/klippy/extras/sx1509.py +++ b/klippy/extras/sx1509.py @@ -104,7 +104,6 @@ class SX1509_digital_out(object): self._invert = pin_params['invert'] self._mcu.register_config_callback(self._build_config) self._start_value = self._shutdown_value = self._invert - self._is_static = False self._max_duration = 2. self._set_cmd = self._clear_cmd = None # Set direction to output @@ -116,12 +115,9 @@ class SX1509_digital_out(object): return self._mcu def setup_max_duration(self, max_duration): self._max_duration = max_duration - def setup_start_value(self, start_value, shutdown_value, is_static=False): - if is_static and start_value != shutdown_value: - raise pins.error("Static pin can not have shutdown value") + def setup_start_value(self, start_value, shutdown_value): self._start_value = (not not start_value) ^ self._invert self._shutdown_value = self._invert - self._is_static = is_static # We need to set the start value here so the register is # updated before the SX1509 class writes it. if self._start_value: @@ -148,7 +144,6 @@ class SX1509_pwm(object): self._invert = pin_params['invert'] self._mcu.register_config_callback(self._build_config) self._start_value = self._shutdown_value = float(self._invert) - self._is_static = False self._max_duration = 2. self._hardware_pwm = False self._pwm_max = 0. @@ -182,15 +177,12 @@ class SX1509_pwm(object): def setup_cycle_time(self, cycle_time, hardware_pwm=False): self._cycle_time = cycle_time self._hardware_pwm = hardware_pwm - def setup_start_value(self, start_value, shutdown_value, is_static=False): - if is_static and start_value != shutdown_value: - raise pins.error("Static pin can not have shutdown value") + def setup_start_value(self, start_value, shutdown_value): if self._invert: start_value = 1. - start_value shutdown_value = 1. - shutdown_value self._start_value = max(0., min(1., start_value)) self._shutdown_value = max(0., min(1., shutdown_value)) - self._is_static = is_static def set_pwm(self, print_time, value, cycle_time=None): self._sx1509.set_register(self._i_on_reg, ~int(255 * value) if not self._invert |