HAL_ChibiOS: fixed build on boards with OTG2 and no CAN interfaces

This commit is contained in:
Andrew Tridgell 2021-09-27 14:47:01 +10:00
parent 9cbb7e146d
commit 27e93155f4

View File

@ -1459,7 +1459,7 @@ def write_UART_config(f):
f.write('#define HAL_HAVE_DUAL_USB_CDC 1\n')
if env_vars.get('AP_PERIPH', 0) == 0:
f.write('''
#if HAL_NUM_CAN_IFACES
#if defined(HAL_NUM_CAN_IFACES) && HAL_NUM_CAN_IFACES
#ifndef HAL_OTG2_PROTOCOL
#define HAL_OTG2_PROTOCOL SerialProtocol_SLCAN
#endif