aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py b/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py
index 0eddb58e9..144314eba 100644
--- a/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py
+++ b/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py
@@ -400,10 +400,12 @@ class DioControl:
:raises RuntimeError: name could not be normalized
"""
assert isinstance(name, str)
- if not name.upper() in self.DIO_PORTS + ("A", "B"):
+ gpio0_names = (self.DIO_PORTS[0], self.X4XX_GPIO_BANKS[0], "A")
+ gpio1_names = (self.DIO_PORTS[1], self.X4XX_GPIO_BANKS[1], "B")
+ if name.upper() not in gpio0_names + gpio1_names:
raise RuntimeError("Could not map %s to port name" % name)
- return self.DIO_PORTS[0] if name.upper() in (self.DIO_PORTS[0], "A") \
- else self.DIO_PORTS[1]
+ return self.DIO_PORTS[0] if name.upper() in gpio0_names \
+ else self.DIO_PORTS[1]
# --------------------------------------------------------------------------
# Helper to format status output