From 3b87b725d14335014fbfa5d19c85b71c46f2f019 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 16 Sep 2018 22:25:17 -0400 Subject: [PATCH] refactoring --- firmware/bootloader/src/dfu.cpp | 3 +-- firmware/bootloader/src/main.cpp | 3 +-- firmware/bootloader/src/rusefi_stubs.cpp | 3 +-- firmware/config/boards/Prometheus/board_configuration.cpp | 2 +- firmware/config/engines/GY6_139QMB.cpp | 2 +- firmware/config/engines/MiniCooperR50.h | 2 +- firmware/config/engines/acura_rsx.cpp | 2 +- firmware/config/engines/audi_aan.cpp | 2 +- firmware/config/engines/daihatsu.cpp | 2 +- firmware/config/engines/dodge_neon.cpp | 2 +- firmware/config/engines/dodge_ram.cpp | 2 +- firmware/config/engines/dodge_stratus.cpp | 2 +- firmware/config/engines/ford_1995_inline_6.cpp | 2 +- firmware/config/engines/ford_aspire.cpp | 2 +- firmware/config/engines/ford_fiesta.cpp | 2 +- firmware/config/engines/honda_accord.cpp | 2 +- firmware/config/engines/mazda_626.cpp | 2 +- firmware/config/engines/nissan_primera.cpp | 2 +- firmware/config/engines/rover_v8.cpp | 2 +- firmware/config/engines/snow_blower.cpp | 2 +- firmware/config/engines/vw.cpp | 2 +- firmware/console/binary/bluetooth.cpp | 2 +- firmware/console/binary/bluetooth.h | 2 +- firmware/console/binary/tunerstudio.cpp | 2 +- firmware/console/binary/tunerstudio.h | 2 +- firmware/console/binary/tunerstudio_io.cpp | 2 +- firmware/console/binary/tunerstudio_io.h | 2 +- firmware/console/console_io.cpp | 2 +- firmware/hw_layer/hardware.cpp | 2 +- firmware/hw_layer/lcd/lcd_HD44780.cpp | 2 +- firmware/hw_layer/max31855.cpp | 2 +- firmware/hw_layer/vehicle_speed.h | 2 +- firmware/rusefi.cpp | 3 +-- firmware/util/cli_registry.cpp | 2 +- firmware/util/datalogging.cpp | 2 +- firmware/util/efilib2.h | 3 +-- 36 files changed, 36 insertions(+), 41 deletions(-) diff --git a/firmware/bootloader/src/dfu.cpp b/firmware/bootloader/src/dfu.cpp index ddeb69f7cf..5fd678d8ed 100644 --- a/firmware/bootloader/src/dfu.cpp +++ b/firmware/bootloader/src/dfu.cpp @@ -1,7 +1,6 @@ -#include "main.h" +#include "global.h" #include "hardware.h" #include "efiGpio.h" -#include "global.h" #include "flash.h" diff --git a/firmware/bootloader/src/main.cpp b/firmware/bootloader/src/main.cpp index f55926be6e..db3d95bb6b 100644 --- a/firmware/bootloader/src/main.cpp +++ b/firmware/bootloader/src/main.cpp @@ -1,8 +1,7 @@ -#include "main.h" +#include "global.h" #include "hardware.h" #include "efiGpio.h" -#include "global.h" #ifdef __cplusplus extern "C" diff --git a/firmware/bootloader/src/rusefi_stubs.cpp b/firmware/bootloader/src/rusefi_stubs.cpp index 9a2a95c108..495079ee33 100644 --- a/firmware/bootloader/src/rusefi_stubs.cpp +++ b/firmware/bootloader/src/rusefi_stubs.cpp @@ -1,7 +1,6 @@ -#include "main.h" +#include "global.h" #include "hardware.h" #include "efiGpio.h" -#include "global.h" /* * We need only a small portion of code from rusEFI codebase in the bootloader. diff --git a/firmware/config/boards/Prometheus/board_configuration.cpp b/firmware/config/boards/Prometheus/board_configuration.cpp index 089b42a418..b070a25f65 100644 --- a/firmware/config/boards/Prometheus/board_configuration.cpp +++ b/firmware/config/boards/Prometheus/board_configuration.cpp @@ -7,7 +7,7 @@ * @author andreika, (c) 2017 */ -#include "main.h" +#include "global.h" #include "engine.h" #include "engine_math.h" #include "allsensors.h" diff --git a/firmware/config/engines/GY6_139QMB.cpp b/firmware/config/engines/GY6_139QMB.cpp index 2d51e72fa3..83ce5652d7 100644 --- a/firmware/config/engines/GY6_139QMB.cpp +++ b/firmware/config/engines/GY6_139QMB.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "GY6_139QMB.h" #include "engine_math.h" #include "engine_configuration.h" diff --git a/firmware/config/engines/MiniCooperR50.h b/firmware/config/engines/MiniCooperR50.h index 9736cf163c..c26260ab36 100644 --- a/firmware/config/engines/MiniCooperR50.h +++ b/firmware/config/engines/MiniCooperR50.h @@ -8,7 +8,7 @@ #ifndef MINICOOPERR50_H_ #define MINICOOPERR50_H_ -#include "main.h" +#include "global.h" #include "engine_configuration.h" void setMiniCooperR50(engine_configuration_s *engineConfiguration); diff --git a/firmware/config/engines/acura_rsx.cpp b/firmware/config/engines/acura_rsx.cpp index 4a65e3a5df..790bce90d3 100644 --- a/firmware/config/engines/acura_rsx.cpp +++ b/firmware/config/engines/acura_rsx.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "acura_rsx.h" void setAcuraRSX(engine_configuration_s *engineConfiguration) { diff --git a/firmware/config/engines/audi_aan.cpp b/firmware/config/engines/audi_aan.cpp index 8fab4cc380..edd1bffc81 100644 --- a/firmware/config/engines/audi_aan.cpp +++ b/firmware/config/engines/audi_aan.cpp @@ -20,7 +20,7 @@ * */ -#include "main.h" +#include "global.h" #if EFI_ENGINE_AUDI_AAN || defined(__DOXYGEN__) diff --git a/firmware/config/engines/daihatsu.cpp b/firmware/config/engines/daihatsu.cpp index bf7aa179f4..ef91b21182 100644 --- a/firmware/config/engines/daihatsu.cpp +++ b/firmware/config/engines/daihatsu.cpp @@ -8,7 +8,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "daihatsu.h" EXTERN_ENGINE; diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 3fb4131605..9b6620bb51 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -14,7 +14,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #if EFI_SUPPORT_DODGE_NEON || defined(__DOXYGEN__) diff --git a/firmware/config/engines/dodge_ram.cpp b/firmware/config/engines/dodge_ram.cpp index 900766a50b..4ec0fd2e00 100644 --- a/firmware/config/engines/dodge_ram.cpp +++ b/firmware/config/engines/dodge_ram.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "dodge_ram.h" #include "custom_engine.h" #include "allsensors.h" diff --git a/firmware/config/engines/dodge_stratus.cpp b/firmware/config/engines/dodge_stratus.cpp index e5105a15b0..ada99dd9b1 100644 --- a/firmware/config/engines/dodge_stratus.cpp +++ b/firmware/config/engines/dodge_stratus.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "dodge_stratus.h" #include "engine_math.h" diff --git a/firmware/config/engines/ford_1995_inline_6.cpp b/firmware/config/engines/ford_1995_inline_6.cpp index 01fbea4898..dd547b99de 100644 --- a/firmware/config/engines/ford_1995_inline_6.cpp +++ b/firmware/config/engines/ford_1995_inline_6.cpp @@ -13,7 +13,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "ford_1995_inline_6.h" #include "engine_math.h" #include "allsensors.h" diff --git a/firmware/config/engines/ford_aspire.cpp b/firmware/config/engines/ford_aspire.cpp index aecc57a899..ae8e0434ce 100644 --- a/firmware/config/engines/ford_aspire.cpp +++ b/firmware/config/engines/ford_aspire.cpp @@ -9,7 +9,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "ford_aspire.h" diff --git a/firmware/config/engines/ford_fiesta.cpp b/firmware/config/engines/ford_fiesta.cpp index 313cb3bd4e..fd6bdb12dc 100644 --- a/firmware/config/engines/ford_fiesta.cpp +++ b/firmware/config/engines/ford_fiesta.cpp @@ -9,7 +9,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__) diff --git a/firmware/config/engines/honda_accord.cpp b/firmware/config/engines/honda_accord.cpp index 86ffc7eb5c..a28d39ab96 100644 --- a/firmware/config/engines/honda_accord.cpp +++ b/firmware/config/engines/honda_accord.cpp @@ -27,7 +27,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "trigger_decoder.h" #include "thermistors.h" #include "honda_accord.h" diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index bfee042cb7..b4a096b5d5 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "mazda_626.h" #include "engine_math.h" #include "honda_accord.h" diff --git a/firmware/config/engines/nissan_primera.cpp b/firmware/config/engines/nissan_primera.cpp index 5e9b71f43d..ef03b08841 100644 --- a/firmware/config/engines/nissan_primera.cpp +++ b/firmware/config/engines/nissan_primera.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #if EFI_SUPPORT_NISSAN_PRIMERA || defined(__DOXYGEN__) #include "nissan_primera.h" diff --git a/firmware/config/engines/rover_v8.cpp b/firmware/config/engines/rover_v8.cpp index 42ec02de45..9004b9f912 100644 --- a/firmware/config/engines/rover_v8.cpp +++ b/firmware/config/engines/rover_v8.cpp @@ -13,7 +13,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "rover_v8.h" #include "engine_math.h" #include "allsensors.h" diff --git a/firmware/config/engines/snow_blower.cpp b/firmware/config/engines/snow_blower.cpp index a73c1632cb..141884b5d2 100644 --- a/firmware/config/engines/snow_blower.cpp +++ b/firmware/config/engines/snow_blower.cpp @@ -6,4 +6,4 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" diff --git a/firmware/config/engines/vw.cpp b/firmware/config/engines/vw.cpp index ea13d02380..b3893fd8f1 100644 --- a/firmware/config/engines/vw.cpp +++ b/firmware/config/engines/vw.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "vw.h" #include "custom_engine.h" #include "ego.h" diff --git a/firmware/console/binary/bluetooth.cpp b/firmware/console/binary/bluetooth.cpp index 037f9d3111..e14abff795 100644 --- a/firmware/console/binary/bluetooth.cpp +++ b/firmware/console/binary/bluetooth.cpp @@ -1,4 +1,4 @@ -#include "main.h" +#include "global.h" #include "engine_state.h" #include "tunerstudio.h" diff --git a/firmware/console/binary/bluetooth.h b/firmware/console/binary/bluetooth.h index 5603fb6072..141dc0c4f2 100644 --- a/firmware/console/binary/bluetooth.h +++ b/firmware/console/binary/bluetooth.h @@ -8,7 +8,7 @@ #ifndef BLUETOOTH_H_ #define BLUETOOTH_H_ -#include "main.h" +#include "global.h" #include "tunerstudio_io.h" diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 25e4fe044f..2ffa48a5f8 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -59,7 +59,7 @@ * */ -#include "main.h" +#include "global.h" #include "engine_state.h" #include "tunerstudio.h" diff --git a/firmware/console/binary/tunerstudio.h b/firmware/console/binary/tunerstudio.h index e0e605d344..f5cc5cc491 100644 --- a/firmware/console/binary/tunerstudio.h +++ b/firmware/console/binary/tunerstudio.h @@ -8,7 +8,7 @@ #ifndef TUNERSTUDIO_H_ #define TUNERSTUDIO_H_ -#include "main.h" +#include "global.h" #include "tunerstudio_io.h" #if EFI_TUNER_STUDIO diff --git a/firmware/console/binary/tunerstudio_io.cpp b/firmware/console/binary/tunerstudio_io.cpp index 69ae3d8fb7..67575bc00b 100644 --- a/firmware/console/binary/tunerstudio_io.cpp +++ b/firmware/console/binary/tunerstudio_io.cpp @@ -5,7 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "tunerstudio_io.h" #include "console_io.h" #include "engine.h" diff --git a/firmware/console/binary/tunerstudio_io.h b/firmware/console/binary/tunerstudio_io.h index c222521c86..ab9d43625d 100644 --- a/firmware/console/binary/tunerstudio_io.h +++ b/firmware/console/binary/tunerstudio_io.h @@ -7,7 +7,7 @@ #ifndef CONSOLE_TUNERSTUDIO_TUNERSTUDIO_IO_H_ #define CONSOLE_TUNERSTUDIO_TUNERSTUDIO_IO_H_ -#include "main.h" +#include "global.h" #if EFI_PROD_CODE #include "usbconsole.h" diff --git a/firmware/console/console_io.cpp b/firmware/console/console_io.cpp index c12aab72ee..e1272887f5 100644 --- a/firmware/console/console_io.cpp +++ b/firmware/console/console_io.cpp @@ -18,7 +18,7 @@ * If not, see . */ -#include "main.h" +#include "global.h" #include "console_io.h" #include "rfiutil.h" #include "tunerstudio.h" diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 71a49b56e0..cd5c66a8d5 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -6,7 +6,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "adc_inputs.h" #include "can_hw.h" #include "console_io.h" diff --git a/firmware/hw_layer/lcd/lcd_HD44780.cpp b/firmware/hw_layer/lcd/lcd_HD44780.cpp index 2b3f84997b..c97fadb0e7 100644 --- a/firmware/hw_layer/lcd/lcd_HD44780.cpp +++ b/firmware/hw_layer/lcd/lcd_HD44780.cpp @@ -7,7 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #if EFI_HD44780_LCD diff --git a/firmware/hw_layer/max31855.cpp b/firmware/hw_layer/max31855.cpp index 23b609e830..6e222181c6 100644 --- a/firmware/hw_layer/max31855.cpp +++ b/firmware/hw_layer/max31855.cpp @@ -12,7 +12,7 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "main.h" +#include "global.h" #include "max31855.h" #include "hardware.h" diff --git a/firmware/hw_layer/vehicle_speed.h b/firmware/hw_layer/vehicle_speed.h index 835e7de523..7ba955aad5 100644 --- a/firmware/hw_layer/vehicle_speed.h +++ b/firmware/hw_layer/vehicle_speed.h @@ -8,7 +8,7 @@ #ifndef HW_LAYER_VEHICLE_SPEED_H_ #define HW_LAYER_VEHICLE_SPEED_H_ -#include "main.h" +#include "global.h" /** * @return vehicle speed, in kilometers per hour diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 3a222f276a..8b36744307 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -104,13 +104,12 @@ * */ -#include "main.h" +#include "global.h" #include "trigger_structure.h" #include "hardware.h" #include "engine_controller.h" #include "efiGpio.h" -#include "global.h" #include "rfi_perftest.h" #include "rusefi.h" #include "memstreams.h" diff --git a/firmware/util/cli_registry.cpp b/firmware/util/cli_registry.cpp index cb1563a55c..456c756093 100644 --- a/firmware/util/cli_registry.cpp +++ b/firmware/util/cli_registry.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "main.h" +#include "global.h" #include "cli_registry.h" #include "efilib.h" diff --git a/firmware/util/datalogging.cpp b/firmware/util/datalogging.cpp index 1372b32906..6636e9f157 100644 --- a/firmware/util/datalogging.cpp +++ b/firmware/util/datalogging.cpp @@ -31,7 +31,7 @@ */ #include -#include "main.h" +#include "global.h" #if ! EFI_UNIT_TEST || defined(__DOXYGEN__) #include "chprintf.h" diff --git a/firmware/util/efilib2.h b/firmware/util/efilib2.h index 566f191fb9..b1a1d7ea24 100644 --- a/firmware/util/efilib2.h +++ b/firmware/util/efilib2.h @@ -9,7 +9,7 @@ #define EFILIB2_H_ #include -#include "main.h" +#include "global.h" typedef struct { // todo: would probably be better to keep the high bits as 32 bit field to be sure @@ -32,7 +32,6 @@ class Overflow64Counter State64 state; }; -#include "main.h" #if (EFI_PROD_CODE || EFI_SIMULATOR) #define GET_TIMESTAMP() port_rt_get_counter_value() #else