From c60c0b8ab164d30b65555679f4f585fef60db4cb Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Fri, 19 Jan 2018 19:06:33 +0530 Subject: [PATCH] HAL_ChibiOS: fix undef line processing --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 11c31a375f..7b07166b4e 100755 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -773,6 +773,12 @@ def process_line(line): spidev.append(a[1:]) if a[0] == 'undef': config.pop(a[1], '') + #also remove all occurences of defines in previous lines if any + for line in alllines: + if line.startswith('define') and a[1] in line: + alllines.remove(line) + +