Browse Source

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

pull/7927/head
robert-hh 3 years ago
committed by Damien George
parent
commit
90b45efa6a
  1. 6
      ports/mimxrt/boards/make-pins.py

6
ports/mimxrt/boards/make-pins.py

@ -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))

Loading…
Cancel
Save