From ab0f1a8887ee81bba3698fa8e0581dce2b6bfde6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 3 Jan 2020 12:50:07 +1100 Subject: [PATCH] HAL_ChibiOS: added max uarts check --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 06271766b4..20be9c3a4d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1122,6 +1122,8 @@ def write_UART_config(f): num_uarts = len(devlist) if 'IOMCU_UART' in config: num_uarts -= 1 + if num_uarts > 8: + error("Exceeded max num UARTs of 8 (%u)" % num_uarts) f.write('#define HAL_UART_NUM_SERIAL_PORTS %u\n' % (num_uarts+num_empty_uarts))