aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJakub Kaderka <jakub.kaderka@gmail.com>2018-12-10 22:34:43 +0100
committerJakub Kaderka <jakub.kaderka@gmail.com>2018-12-10 22:34:43 +0100
commit92b21d872d5edcac773843986a645c2e1e572b03 (patch)
tree94fff2412875591272e4ace0fc01f12d41a1547e /tools
parentc4519da48a02bebfde897e3227ae40b600fa1cb0 (diff)
downloadChibiOS-Contrib-92b21d872d5edcac773843986a645c2e1e572b03.tar.gz
ChibiOS-Contrib-92b21d872d5edcac773843986a645c2e1e572b03.tar.bz2
ChibiOS-Contrib-92b21d872d5edcac773843986a645c2e1e572b03.zip
Fixed board generation for pins with note in name
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mx2board.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/mx2board.py b/tools/mx2board.py
index 132689e..99b54a3 100755
--- a/tools/mx2board.py
+++ b/tools/mx2board.py
@@ -171,7 +171,11 @@ def read_gpio(filename):
for pin in root.findall('GPIO_Pin'):
try:
port = pin.attrib['Name'][1]
- num = int(pin.attrib['Name'][2:])
+ num = pin.attrib['Name'][2:]
+ # remove notes from pin name (e.g. PH0 - OSC_IN)
+ num = num.split('-')[0].strip()
+ num = int(num)
+
if port not in gpio['ports']:
gpio['ports'][port] = {}
if num not in gpio['ports'][port]: