mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 00:58:37 -04:00
HAL_ChibiOS: fixed serial info indexing for EMPTY uarts
This commit is contained in:
parent
6fab8feeae
commit
c34d8e80e9
@ -1199,12 +1199,11 @@ def write_UART_config(f):
|
||||
devnames = "ABCDEFGHI"
|
||||
sdev = 0
|
||||
idx = 0
|
||||
num_empty_uarts = 0
|
||||
for dev in uart_list:
|
||||
if dev == 'EMPTY':
|
||||
f.write('#define HAL_UART%s_DRIVER Empty::UARTDriver uart%sDriver\n' %
|
||||
(devnames[idx], devnames[idx]))
|
||||
num_empty_uarts += 1
|
||||
sdev += 1
|
||||
else:
|
||||
f.write(
|
||||
'#define HAL_UART%s_DRIVER ChibiOS::UARTDriver uart%sDriver(%u)\n'
|
||||
@ -1242,6 +1241,7 @@ def write_UART_config(f):
|
||||
elif dev.startswith('OTG'):
|
||||
n = int(dev[3:])
|
||||
elif dev.startswith('EMPTY'):
|
||||
devlist.append('{}')
|
||||
continue
|
||||
else:
|
||||
error("Invalid element %s in UART_ORDER" % dev)
|
||||
@ -1307,7 +1307,7 @@ def write_UART_config(f):
|
||||
num_uarts -= 1
|
||||
if num_uarts > 9:
|
||||
error("Exceeded max num UARTs of 9 (%u)" % num_uarts)
|
||||
f.write('#define HAL_UART_NUM_SERIAL_PORTS %u\n' % (num_uarts+num_empty_uarts))
|
||||
f.write('#define HAL_UART_NUM_SERIAL_PORTS %u\n' % num_uarts)
|
||||
|
||||
|
||||
def write_UART_config_bootloader(f):
|
||||
|
Loading…
Reference in New Issue
Block a user