diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 6a06440fe9..c67fe5ea5a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -2671,6 +2671,9 @@ def process_line(line): bylabel.pop(u, '') alttype.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 for line in alllines[:]: if line.startswith('define') and u == line.split()[1]: