diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 2cdefa5718..4dc87042ee 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -691,6 +691,13 @@ class chibios(Board): else: cfg.msg("Enabling malloc guard", "no") + if cfg.env.ENABLE_STATS: + cfg.msg("Enabling ChibiOS thread statistics", "yes") + env.CFLAGS += [ '-DHAL_ENABLE_THREAD_STATISTICS' ] + env.CXXFLAGS += [ '-DHAL_ENABLE_THREAD_STATISTICS' ] + else: + cfg.msg("Enabling ChibiOS thread statistics", "no") + env.LIB += ['gcc', 'm'] env.GIT_SUBMODULES += [ diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index a5d1036cf8..36d3dfbb55 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -294,6 +294,8 @@ def load_env_vars(env): env.CHIBIOS_BUILD_FLAGS += ' ENABLE_ASSERTS=yes' if env.ENABLE_MALLOC_GUARD: env.CHIBIOS_BUILD_FLAGS += ' ENABLE_MALLOC_GUARD=yes' + if env.ENABLE_STATS: + env.CHIBIOS_BUILD_FLAGS += ' ENABLE_STATS=yes' def setup_optimization(env):