mirror of https://github.com/Desuuuu/klipper.git
bus: Allow reserving hardware interfaces with [name] syntax
The special name "_" is treated as the bus name.
This commit is contained in:
parent
e21ba2e94f
commit
81629071b1
|
@ -31,6 +31,13 @@ def resolve_bus_name(mcu, param, bus):
|
||||||
if reserve_pins is not None:
|
if reserve_pins is not None:
|
||||||
pin_resolver = ppins.get_pin_resolver(mcu_name)
|
pin_resolver = ppins.get_pin_resolver(mcu_name)
|
||||||
for pin in reserve_pins.split(','):
|
for pin in reserve_pins.split(','):
|
||||||
|
if pin.startswith('[') and pin.endswith(']'):
|
||||||
|
interface = pin[1:-1]
|
||||||
|
if interface == '_':
|
||||||
|
interface = bus
|
||||||
|
pin_resolver.reserve_interface(interface, "%s[%s]" % (
|
||||||
|
param, bus))
|
||||||
|
else:
|
||||||
pin_resolver.reserve_pin(pin, bus)
|
pin_resolver.reserve_pin(pin, bus)
|
||||||
return bus
|
return bus
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue