From 7e3b538b161a65e78823d48dbdcf15b977de6f40 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 23 Mar 2023 17:43:27 +1100 Subject: [PATCH] waf: added --board-start-time configure option --- Tools/ardupilotwaf/chibios.py | 2 ++ wscript | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index 89e2c9df86..04d93eb872 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -496,6 +496,8 @@ def load_env_vars(env): env.CHIBIOS_BUILD_FLAGS += ' ENABLE_STATS=yes' if env.ENABLE_DFU_BOOT and env.BOOTLOADER: 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): diff --git a/wscript b/wscript index a97013f7fa..8c4e40d221 100644 --- a/wscript +++ b/wscript @@ -386,6 +386,11 @@ configuration in order to save typing. default=0, 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): for m in sys.modules.values(): paths = [] @@ -456,6 +461,11 @@ def configure(cfg): if cfg.options.num_aux_imus > 0: 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.msg('Setting board to', cfg.options.board)