aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/bus.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-04-07 20:43:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-04-07 20:43:23 -0400
commitd7e1061c63820323dcb68960baf37875ec216fc2 (patch)
tree775b5a546a1e73f7e4d08af0139d148682a29e56 /klippy/extras/bus.py
parent38f3d65ac5dabbad69469e0b3a25d2a9d4bee54c (diff)
downloadkutter-d7e1061c63820323dcb68960baf37875ec216fc2.tar.gz
kutter-d7e1061c63820323dcb68960baf37875ec216fc2.tar.xz
kutter-d7e1061c63820323dcb68960baf37875ec216fc2.zip
bus: Don't reserve any pins if BUS_PINS_x is not defined
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/bus.py')
-rw-r--r--klippy/extras/bus.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/klippy/extras/bus.py b/klippy/extras/bus.py
index b8deb22b..8bd4bc9f 100644
--- a/klippy/extras/bus.py
+++ b/klippy/extras/bus.py
@@ -25,9 +25,10 @@ def resolve_bus_name(mcu, param, bus):
raise ppins.error("Unknown %s '%s'" % (param, bus))
# Check for reserved bus pins
constants = mcu.get_constants()
- reserve_pins = constants.get('BUS_PINS_%s' % (bus,), '')
- for pin in reserve_pins.split(','):
- ppins.reserve_pin(mcu_name, pin, bus)
+ reserve_pins = constants.get('BUS_PINS_%s' % (bus,), None)
+ if reserve_pins is not None:
+ for pin in reserve_pins.split(','):
+ ppins.reserve_pin(mcu_name, pin, bus)
return bus