waf: added --board-start-time configure option

This commit is contained in:
Andrew Tridgell 2023-03-23 17:43:27 +11:00
parent 726b3bca9d
commit 7e3b538b16
2 changed files with 12 additions and 0 deletions

View File

@ -496,6 +496,8 @@ def load_env_vars(env):
env.CHIBIOS_BUILD_FLAGS += ' ENABLE_STATS=yes' env.CHIBIOS_BUILD_FLAGS += ' ENABLE_STATS=yes'
if env.ENABLE_DFU_BOOT and env.BOOTLOADER: if env.ENABLE_DFU_BOOT and env.BOOTLOADER:
env.CHIBIOS_BUILD_FLAGS += ' USE_ASXOPT=-DCRT0_ENTRY_HOOK=TRUE' env.CHIBIOS_BUILD_FLAGS += ' USE_ASXOPT=-DCRT0_ENTRY_HOOK=TRUE'
if env.AP_BOARD_START_TIME:
env.CHIBIOS_BUILD_FLAGS += ' AP_BOARD_START_TIME=0x%x' % env.AP_BOARD_START_TIME
def setup_optimization(env): def setup_optimization(env):

10
wscript
View File

@ -386,6 +386,11 @@ configuration in order to save typing.
default=0, default=0,
help='number of auxiliary IMUs') help='number of auxiliary IMUs')
g.add_option('--board-start-time',
type='int',
default=0,
help='zero time on boot in microseconds')
def _collect_autoconfig_files(cfg): def _collect_autoconfig_files(cfg):
for m in sys.modules.values(): for m in sys.modules.values():
paths = [] paths = []
@ -456,6 +461,11 @@ def configure(cfg):
if cfg.options.num_aux_imus > 0: if cfg.options.num_aux_imus > 0:
cfg.define('INS_AUX_INSTANCES', cfg.options.num_aux_imus) cfg.define('INS_AUX_INSTANCES', cfg.options.num_aux_imus)
if cfg.options.board_start_time != 0:
cfg.define('AP_BOARD_START_TIME', cfg.options.board_start_time)
# also in env for hrt.c
cfg.env.AP_BOARD_START_TIME = cfg.options.board_start_time
cfg.load('ap_library') cfg.load('ap_library')
cfg.msg('Setting board to', cfg.options.board) cfg.msg('Setting board to', cfg.options.board)