From 92b21d872d5edcac773843986a645c2e1e572b03 Mon Sep 17 00:00:00 2001 From: Jakub Kaderka Date: Mon, 10 Dec 2018 22:34:43 +0100 Subject: Fixed board generation for pins with note in name --- tools/mx2board.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools') 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]: -- cgit v1.2.3