ardupilotwaf: set flags for CANFD support as applicable

This commit is contained in:
Siddharth Purohit 2021-05-17 22:59:38 +05:30 committed by Andrew Tridgell
parent ef1bdc2e5f
commit 5e54871d82
2 changed files with 12 additions and 0 deletions

View File

@ -937,6 +937,12 @@ class chibios(Board):
('10','2','1'),
]
if cfg.env.AP_PERIPH:
if cfg.env.HAL_CANFD_SUPPORTED:
env.DEFINES.update(CANARD_ENABLE_CANFD=1)
else:
env.DEFINES.update(CANARD_ENABLE_CANFD=0)
if cfg.options.Werror or cfg.env.CC_VERSION in gcc_whitelist:
cfg.msg("Enabling -Werror", "yes")
if '-Werror' not in env.CXXFLAGS:

View File

@ -360,6 +360,12 @@ def setup_canmgr_build(cfg):
'UAVCAN_NULLPTR=nullptr'
]
if cfg.env.HAL_CANFD_SUPPORTED:
env.DEFINES += ['UAVCAN_SUPPORT_CANFD=1']
else:
env.DEFINES += ['UAVCAN_SUPPORT_CANFD=0']
env.INCLUDES += [
cfg.srcnode.find_dir('modules/uavcan/libuavcan/include').abspath(),
]