AP_HAL_ChibiOS: add hwdef config to enable CANFD support

This commit is contained in:
Siddharth Purohit 2021-05-17 23:08:11 +05:30 committed by Andrew Tridgell
parent 5bc65bb54e
commit 72090d10da
2 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,8 @@ APJ_BOARD_ID 140
FLASH_SIZE_KB 2048 FLASH_SIZE_KB 2048
CANFD_SUPPORTED 1
# with 2M flash we can afford to optimize for speed # with 2M flash we can afford to optimize for speed
env OPTIMIZE -O2 env OPTIMIZE -O2

View File

@ -689,6 +689,13 @@ def enable_can(f):
if 'CAN' in bytype and mcu_type.startswith("STM32F3"): if 'CAN' in bytype and mcu_type.startswith("STM32F3"):
f.write('#define CAN1_BASE CAN_BASE\n') f.write('#define CAN1_BASE CAN_BASE\n')
env_vars['HAL_NUM_CAN_IFACES'] = str(len(base_list)) env_vars['HAL_NUM_CAN_IFACES'] = str(len(base_list))
canfd_supported = get_config('CANFD_SUPPORTED', 0, required=False)
if canfd_supported:
f.write('#define HAL_CANFD_SUPPORTED 1\n')
env_vars['HAL_CANFD_SUPPORTED'] = 1
else:
f.write('#define HAL_CANFD_SUPPORTED 0\n')
env_vars['HAL_CANFD_SUPPORTED'] = 0
def has_sdcard_spi(): def has_sdcard_spi():