From 4d7c6e3005d100727aa49e8e833cc806f42ed925 Mon Sep 17 00:00:00 2001 From: Desuuuu Date: Sun, 22 May 2022 18:20:24 +0200 Subject: [PATCH] bus: Allow bus-specific pin reservations --- klippy/extras/bus.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/klippy/extras/bus.py b/klippy/extras/bus.py index f37897d8..11218465 100644 --- a/klippy/extras/bus.py +++ b/klippy/extras/bus.py @@ -25,9 +25,11 @@ 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,), None) - pin_resolver = ppins.get_pin_resolver(mcu_name) + reserve_pins = constants.get('BUS_PINS_%s@%s' % (bus, param), None) + if reserve_pins is None: + reserve_pins = constants.get('BUS_PINS_%s' % (bus,), None) if reserve_pins is not None: + pin_resolver = ppins.get_pin_resolver(mcu_name) for pin in reserve_pins.split(','): pin_resolver.reserve_pin(pin, bus) return bus