AP_HAL_ChibiOS: allow undef of SPI devices

This commit is contained in:
Andy Piper 2022-07-22 16:42:19 +01:00 committed by Andrew Tridgell
parent 7fc5a7135a
commit 1ff3ee7a12
1 changed files with 3 additions and 0 deletions

View File

@ -2671,6 +2671,9 @@ def process_line(line):
bylabel.pop(u, '') bylabel.pop(u, '')
alttype.pop(u, '') alttype.pop(u, '')
altlabel.pop(u, '') altlabel.pop(u, '')
for dev in spidev:
if u == dev[0]:
spidev.remove(dev)
# also remove all occurences of defines in previous lines if any # also remove all occurences of defines in previous lines if any
for line in alllines[:]: for line in alllines[:]:
if line.startswith('define') and u == line.split()[1]: if line.startswith('define') and u == line.split()[1]: