From caa06b62dfceda8411cfb53922ad74c654b4d9ba Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 15 Nov 2019 14:50:29 +1100 Subject: [PATCH] HAL_ChibiOS: setup define for number of serial ports --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index bdf4edbc0e..c2c1cd23ea 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1034,6 +1034,10 @@ def write_UART_config(f): #define HAL_USE_SERIAL HAL_USE_SERIAL_USB #endif ''') + num_uarts = len(devlist) + if 'IOMCU_UART' in config: + num_uarts -= 1 + f.write('#define HAL_UART_NUM_SERIAL_PORTS %u\n' % num_uarts) def write_UART_config_bootloader(f): '''write UART config defines'''