Fixed board generation for pins with note in name

This commit is contained in:
Jakub Kaderka 2018-12-10 22:34:43 +01:00
parent c4519da48a
commit 92b21d872d
1 changed files with 5 additions and 1 deletions

View File

@ -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]: