waf: added board name to ChibiOS build

This commit is contained in:
Andrew Tridgell 2018-02-06 09:47:23 +11:00
parent 4b8bde746e
commit 13a3c56a02
2 changed files with 5 additions and 2 deletions

View File

@ -273,6 +273,9 @@ class chibios(Board):
'AP_HAL_ChibiOS', 'AP_HAL_ChibiOS',
] ]
# make board name available for USB IDs
env.CHIBIOS_BOARD_NAME = 'HAL_BOARD_NAME="%s"' % self.name
env.CXXFLAGS += [ env.CXXFLAGS += [
'-Wlogical-op', '-Wlogical-op',
'-Wframe-larger-than=1300', '-Wframe-larger-than=1300',

View File

@ -156,7 +156,7 @@ def build(bld):
bld( bld(
# create the file modules/ChibiOS/include_dirs # create the file modules/ChibiOS/include_dirs
rule='touch Makefile && BUILDDIR=${BUILDDIR} CHIBIOS=${CH_ROOT} AP_HAL=${AP_HAL_ROOT} ${CHIBIOS_FATFS_FLAG} ${MAKE} pass -f ${BOARD_MK}', rule='touch Makefile && BUILDDIR=${BUILDDIR} CHIBIOS=${CH_ROOT} AP_HAL=${AP_HAL_ROOT} ${CHIBIOS_FATFS_FLAG} ${CHIBIOS_BOARD_NAME} ${MAKE} pass -f ${BOARD_MK}',
group='dynamic_sources', group='dynamic_sources',
target='modules/ChibiOS/include_dirs' target='modules/ChibiOS/include_dirs'
) )
@ -169,7 +169,7 @@ def build(bld):
common_src += bld.path.ant_glob('modules/ChibiOS/os/hal/**/*.mk') common_src += bld.path.ant_glob('modules/ChibiOS/os/hal/**/*.mk')
ch_task = bld( ch_task = bld(
# build libch.a from ChibiOS sources and hwdef.h # build libch.a from ChibiOS sources and hwdef.h
rule="BUILDDIR='${BUILDDIR}' CHIBIOS='${CH_ROOT}' AP_HAL=${AP_HAL_ROOT} ${CHIBIOS_FATFS_FLAG} '${MAKE}' lib -f ${BOARD_MK}", rule="BUILDDIR='${BUILDDIR}' CHIBIOS='${CH_ROOT}' AP_HAL=${AP_HAL_ROOT} ${CHIBIOS_FATFS_FLAG} ${CHIBIOS_BOARD_NAME} '${MAKE}' lib -f ${BOARD_MK}",
group='dynamic_sources', group='dynamic_sources',
source=common_src, source=common_src,
target='modules/ChibiOS/libch.a' target='modules/ChibiOS/libch.a'