diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-03-12 12:31:07 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2019-03-17 19:38:18 -0400 |
commit | ae24baf99a8be29fc3850580cd2c282f3d1b055e (patch) | |
tree | 63e8dbccffd779230746aed5e7dd7900ae4780cf /klippy | |
parent | 91cf497656a9ffaf2b35916bb1101fc4ac844539 (diff) | |
download | kutter-ae24baf99a8be29fc3850580cd2c282f3d1b055e.tar.gz kutter-ae24baf99a8be29fc3850580cd2c282f3d1b055e.tar.xz kutter-ae24baf99a8be29fc3850580cd2c282f3d1b055e.zip |
pru: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/pins.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/klippy/pins.py b/klippy/pins.py index 26d0bf67..8cd9f636 100644 --- a/klippy/pins.py +++ b/klippy/pins.py @@ -13,18 +13,7 @@ class error(Exception): # Hardware pin names ###################################################################### -def named_pins(fmt, port_count, bit_count=32): - return { fmt % (port, portbit) : port * bit_count + portbit - for port in range(port_count) - for portbit in range(bit_count) } - -def beaglebone_pins(): - gpios = named_pins("gpio%d_%d", 4) - gpios.update({"AIN%d" % i: i+4*32 for i in range(8)}) - return gpios - MCU_PINS = { - "pru": beaglebone_pins(), "linux": {"analog%d" % i: i for i in range(8)}, # XXX } @@ -141,8 +130,7 @@ beagleboneblack_mappings = { def update_map_beaglebone(pins, mcu): if mcu != 'pru': raise error("Beaglebone aliases not supported on mcu '%s'" % (mcu,)) - for pin, gpio in beagleboneblack_mappings.items(): - pins[pin] = pins[gpio] + pins.update(beagleboneblack_mappings) ###################################################################### |