diff --git a/firmware/controllers/algo/nmea.c b/firmware/controllers/algo/nmea.c index 483d00e4ae..ce815c64ff 100644 --- a/firmware/controllers/algo/nmea.c +++ b/firmware/controllers/algo/nmea.c @@ -20,7 +20,6 @@ * see #testGpsParser */ #include "global.h" -#include #include #include "nmea.h" diff --git a/firmware/controllers/core/common_headers.h b/firmware/controllers/core/common_headers.h new file mode 100644 index 0000000000..850d2b27cb --- /dev/null +++ b/firmware/controllers/core/common_headers.h @@ -0,0 +1,28 @@ +/* + * @file common_headers.h + * + * @date Sep 16, 2018 + * @author Andrey Belomutskiy, (c) 2012-2018 + */ + +#ifndef CONTROLLERS_CORE_COMMON_HEADERS_H_ +#define CONTROLLERS_CORE_COMMON_HEADERS_H_ + +#include "efifeatures.h" + +#include +#include +#include + +#include "error_handling.h" +#include "auto_generated_enums.h" +#include "rusefi_enums.h" +#include "efilib.h" +#include "efitime.h" + +#ifdef __cplusplus +#include "datalogging.h" +#include "loggingcentral.h" +#endif /* __cplusplus */ + +#endif /* CONTROLLERS_CORE_COMMON_HEADERS_H_ */ diff --git a/firmware/controllers/core/interpolation.cpp b/firmware/controllers/core/interpolation.cpp index 9848748eb6..c016efdcbc 100644 --- a/firmware/controllers/core/interpolation.cpp +++ b/firmware/controllers/core/interpolation.cpp @@ -11,11 +11,6 @@ */ #include "global.h" -#if DEBUG_FUEL -#include -#endif - -#include #include "efilib2.h" #include "interpolation.h" diff --git a/firmware/controllers/error_handling.cpp b/firmware/controllers/error_handling.cpp index e316e976f6..9b7fb33c59 100644 --- a/firmware/controllers/error_handling.cpp +++ b/firmware/controllers/error_handling.cpp @@ -5,11 +5,9 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "global.h" -#include "error_handling.h" +#include "engine.h" #include "io_pins.h" #include "efilib2.h" -#include "engine.h" #if EFI_SIMULATOR || EFI_PROD_CODE //todo: move into simulator global diff --git a/firmware/controllers/error_handling.h b/firmware/controllers/error_handling.h index ac2028d2df..c5224cfbc8 100644 --- a/firmware/controllers/error_handling.h +++ b/firmware/controllers/error_handling.h @@ -15,7 +15,6 @@ extern "C" #include "global.h" #include "obd_error_codes.h" -#include "efifeatures.h" #include "stdbool.h" #include "rusefi_types.h" diff --git a/firmware/controllers/lcd_controller.cpp b/firmware/controllers/lcd_controller.cpp index 169c1faff2..1792fba3ed 100644 --- a/firmware/controllers/lcd_controller.cpp +++ b/firmware/controllers/lcd_controller.cpp @@ -19,7 +19,6 @@ #include "global.h" #include "lcd_controller.h" #include "lcd_HD44780.h" -#include "efilib.h" #include "rpm_calculator.h" #include "allsensors.h" #include "engine.h" diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index bb711551d6..07e5adefb9 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -10,7 +10,6 @@ #include "engine_math.h" #include "analog_input.h" #include "interpolation.h" -#include "error_handling.h" #include "map.h" #include "engine_controller.h" diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index f461266f8a..f64e4adea0 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -431,7 +431,6 @@ static void triggerShapeInfo(void) { } #if EFI_UNIT_TEST || defined(__DOXYGEN__) -#include #include #define TRIGGERS_FILE_NAME "triggers.txt" diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index 826c979b3f..af4076c625 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -20,7 +20,6 @@ #include "global.h" #include "trigger_structure.h" -#include "error_handling.h" #include "trigger_decoder.h" #include "engine_math.h" #include "trigger_universal.h" diff --git a/firmware/global.h b/firmware/global.h index 32f16e19bd..dd5f111178 100644 --- a/firmware/global.h +++ b/firmware/global.h @@ -18,9 +18,7 @@ extern "C" #include #include -#include #include -#include #ifndef DEFAULT_ENGINE_TYPE #define DEFAULT_ENGINE_TYPE CUSTOM_ENGINE @@ -38,16 +36,17 @@ typedef unsigned int time_t; #define ALWAYS_INLINE INLINE #endif -#include "efifeatures.h" -#include "rusefi_types.h" -#include "rusefi_enums.h" -#include "io_pins.h" -#include "auto_generated_enums.h" -#include "obd_error_codes.h" -#include "error_handling.h" +#include "common_headers.h" -#include "efitime.h" -#include "efilib.h" +#include "io_pins.h" + +#ifdef __cplusplus +#include "cli_registry.h" + +#include "eficonsole.h" +#endif /* __cplusplus */ + +#include "chprintf.h" /* definition to expand macro then apply to pragma message */ #define VALUE_TO_STRING(x) #x @@ -143,18 +142,6 @@ typedef unsigned int time_t; */ int getRemainingStack(thread_t *otp); - - - -#ifdef __cplusplus -#include "cli_registry.h" -#include "datalogging.h" -#include "loggingcentral.h" -#include "eficonsole.h" -#endif /* __cplusplus */ - -#include "chprintf.h" - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/firmware/main.h b/firmware/main.h deleted file mode 100644 index 658ef1ffd0..0000000000 --- a/firmware/main.h +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @file main.h - * - * @date Nov 29, 2012 - * @author Andrey Belomutskiy, (c) 2012-2017 - */ - -#include "global.h" diff --git a/simulator/main.h b/simulator/main.h deleted file mode 100644 index 84f0e449b7..0000000000 --- a/simulator/main.h +++ /dev/null @@ -1,3 +0,0 @@ - -#include "global.h" - diff --git a/simulator/simulator/global.h b/simulator/simulator/global.h index 19b947f686..4c13401479 100644 --- a/simulator/simulator/global.h +++ b/simulator/simulator/global.h @@ -15,29 +15,18 @@ #include #include -#include -#include #include #include -#include #include -#include "efifeatures.h" +#include "common_headers.h" -#include "auto_generated_enums.h" #include "boards.h" -#include "efilib.h" -#include "efitime.h" -#include "error_handling.h" -#include "rusefi_enums.h" -#include "obd_error_codes.h" #ifdef __cplusplus #include "chprintf.h" #include "cli_registry.h" -#include "datalogging.h" #include "eficonsole.h" -#include "loggingcentral.h" #endif /* __cplusplus */ #define EFI_UNIT_TEST FALSE @@ -62,8 +51,6 @@ #define CCM_OPTIONAL -#include "rusefi_enums.h" - #define EFI_CUSTOM_PANIC_METHOD 1 // project-wide default thread stack size diff --git a/unit_tests/global.h b/unit_tests/global.h index 27633f5c9b..81c4df6851 100644 --- a/unit_tests/global.h +++ b/unit_tests/global.h @@ -13,27 +13,15 @@ #define DEFAULT_ENGINE_TYPE CUSTOM_ENGINE #include -#include +#include #include -#include "efitime.h" -#include "auto_generated_enums.h" - -#include -#include -#include "efitime.h" - -#include "error_handling.h" -#include "efifeatures.h" - -#include "efilib.h" -#include "efitime.h" +#include "common_headers.h" #include "boards.h" #ifdef __cplusplus -#include "datalogging.h" -#include "loggingcentral.h" + extern "C" { diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index 20c96e3546..72c7ac151b 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -5,13 +5,10 @@ * @author Andrey Belomutskiy (c) 2012-2018 */ -#include -#include -#include +#include #include "global.h" -#include "error_handling.h" #include "test_accel_enrichment.h" #include "test_interpolation_3d.h" #include "test_find_index.h" diff --git a/unit_tests/main.h b/unit_tests/main.h deleted file mode 100644 index 027fa957e1..0000000000 --- a/unit_tests/main.h +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @file main.h - * @brief Test version of main.h - * - * @date Oct 17, 2013 - * @author Andrey Belomutskiy, (c) 2012-2017 - */ - -#include "global.h" - - diff --git a/unit_tests/map_resize.cpp b/unit_tests/map_resize.cpp index 9cd59d3e8d..41723735e4 100644 --- a/unit_tests/map_resize.cpp +++ b/unit_tests/map_resize.cpp @@ -5,11 +5,9 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include +#include "engine_configuration.h" #include "fuel_math.h" #include "interpolation.h" -#include "engine_configuration.h" -#include "global.h" #if 1 diff --git a/unit_tests/test_idle_controller.cpp b/unit_tests/test_idle_controller.cpp index d6f3eeefee..8923c2ad9f 100644 --- a/unit_tests/test_idle_controller.cpp +++ b/unit_tests/test_idle_controller.cpp @@ -5,13 +5,9 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include - -#include "efitime.h" #include "engine_test_helper.h" #include "pid.h" - void testPidController(void) { print("******************************************* testPidController\r\n"); pid_s pidS;