diff options
author | Jakub Kaderka <jakub.kaderka@gmail.com> | 2018-12-10 22:34:43 +0100 |
---|---|---|
committer | Jakub Kaderka <jakub.kaderka@gmail.com> | 2018-12-10 22:34:43 +0100 |
commit | 92b21d872d5edcac773843986a645c2e1e572b03 (patch) | |
tree | 94fff2412875591272e4ace0fc01f12d41a1547e /tools | |
parent | c4519da48a02bebfde897e3227ae40b600fa1cb0 (diff) | |
download | ChibiOS-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-x | tools/mx2board.py | 6 |
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]: |