aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/spi_temperature.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-07-26 09:44:45 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-07-26 09:44:45 -0400
commit273a98d39a88a372c8a2c816622e7df1f777e77d (patch)
tree2e8d4253f901a093d745127d97fd2464098d9266 /klippy/extras/spi_temperature.py
parent7a9553b38a39398226d95b7569a0b889b8cdb10a (diff)
downloadkutter-273a98d39a88a372c8a2c816622e7df1f777e77d.tar.gz
kutter-273a98d39a88a372c8a2c816622e7df1f777e77d.tar.xz
kutter-273a98d39a88a372c8a2c816622e7df1f777e77d.zip
pins: Explicitly pass can_invert and can_pullup to lookup_pin()
Don't pass pin_type to lookup_pin() - instead, if a pin can be inverted or can have a pullup, then the caller must explicitly specify that when calling lookup_pin(). This simplifies the code for the cases where it is not valid to invert or pullup. Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin() apply default pullup and invert flags. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/spi_temperature.py')
-rw-r--r--klippy/extras/spi_temperature.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/klippy/extras/spi_temperature.py b/klippy/extras/spi_temperature.py
index 10ea1a8f..18e6dc69 100644
--- a/klippy/extras/spi_temperature.py
+++ b/klippy/extras/spi_temperature.py
@@ -26,8 +26,7 @@ class SensorBase:
self.min_sample_value = self.max_sample_value = 0
self._report_clock = 0
ppins = config.get_printer().lookup_object('pins')
- sensor_pin = config.get('sensor_pin')
- pin_params = ppins.lookup_pin('digital_out', sensor_pin)
+ pin_params = ppins.lookup_pin(config.get('sensor_pin'))
self.mcu = mcu = pin_params['chip']
pin = pin_params['pin']
# SPI bus configuration