HAL_ChibiOS: fixed duplicate pin definitions

thanks to @liang-tang for noticing
This commit is contained in:
Andrew Tridgell 2018-07-05 11:22:12 +10:00
parent 53dcf5bef8
commit 15ee9593b5
1 changed files with 5 additions and 1 deletions

View File

@ -934,10 +934,14 @@ def write_GPIO_config(f):
# and write #defines for use by config code
f.write('}\n\n')
f.write('// full pin define list\n')
for l in sorted(bylabel.keys()):
last_label = None
for l in sorted(list(set(bylabel.keys()))):
p = bylabel[l]
label = p.label
label = label.replace('-', '_')
if label == last_label:
continue
last_label = label
f.write('#define HAL_GPIO_PIN_%-20s PAL_LINE(GPIO%s,%uU)\n' %
(label, p.port, p.pin))
f.write('\n')