From db808011919d551add7d4a1d1309e3d8fc9c342e Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 20 Jan 2019 23:44:05 -0500 Subject: [PATCH] refactoring: reducing header tree hell --- firmware/controllers/algo/accel_enrichment.h | 2 +- unit_tests/global.h | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/firmware/controllers/algo/accel_enrichment.h b/firmware/controllers/algo/accel_enrichment.h index cff1e6d0b1..eab48862b9 100644 --- a/firmware/controllers/algo/accel_enrichment.h +++ b/firmware/controllers/algo/accel_enrichment.h @@ -10,7 +10,7 @@ #ifndef ACC_ENRICHMENT_H_ #define ACC_ENRICHMENT_H_ -#include "engine_configuration.h" +#include "global.h" #include "cyclic_buffer.h" #include "table_helper.h" diff --git a/unit_tests/global.h b/unit_tests/global.h index b8bddb886e..9772001a1a 100644 --- a/unit_tests/global.h +++ b/unit_tests/global.h @@ -17,6 +17,15 @@ #include "boards.h" +// this is needed by all DECLARE_ENGINE_PARAMETER_* usages +#include "engine_configuration_generated_structures.h" + +#ifdef __cplusplus +// this is needed by all DECLARE_ENGINE_PARAMETER_* usages +class Engine; +#endif /* __cplusplus */ + + #ifdef __cplusplus // todo: include it right here? #include "unit_test_framework.h" extern "C" @@ -60,10 +69,6 @@ void print(const char *fmt, ...); #define EXTERN_ENGINE extern EnginePins enginePins #define EXTERN_CONFIG -#ifdef __cplusplus -class Engine; -#endif /* __cplusplus */ - /** * @see firmware/global.h for explanation */