mimxrt/boards/make-pins.py: Allow empty lines and comments in pins.csv.

pull/7927/head
robert-hh 2021-09-16 08:40:01 +02:00 zatwierdzone przez Damien George
rodzic 6754213a9d
commit 90b45efa6a
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -180,6 +180,12 @@ class Pins(object):
with open(filename, "r") as csvfile:
rows = csv.reader(csvfile)
for row in rows:
if len(row) == 0 or row[0].startswith("#"):
# Skip empty lines, and lines starting with "#"
continue
if len(row) != 2:
raise ValueError("Expecting two entries in a row")
pin = self.find_pin_by_name(row[1])
if pin and row[0]: # Only add board pins that have a name
self.board_pins.append(NamedPin(row[0], pin.pad, pin.idx))