File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 4
4
Generates pin source files based on an MCU alternate-function definition (eg
5
5
stm32f405_af.csv) and a board-specific pin definition file, pins.csv.
6
6
7
- The pins.csv file must contain lines of the form:
7
+ The pins.csv file can contain empty lines, comments (a line beginning with "#")
8
+ or pin definition lines. Pin definition lines must be of the form:
8
9
9
10
board,cpu
10
11
@@ -362,6 +363,12 @@ def parse_board_file(self, filename):
362
363
with open (filename , "r" ) as csvfile :
363
364
rows = csv .reader (csvfile )
364
365
for row in rows :
366
+ if len (row ) == 0 or row [0 ].startswith ("#" ):
367
+ # Skip empty lines, and lines starting with "#"
368
+ continue
369
+ if len (row ) != 2 :
370
+ raise ValueError ("Expecting two entries in a row" )
371
+
365
372
cpu_pin_name = row [1 ]
366
373
cpu_pin_hidden = False
367
374
if cpu_pin_name .startswith ("-" ):
You can’t perform that action at this time.
0 commit comments