diff --git a/firmware/development/rfi_perftest.h b/firmware/development/rfi_perftest.h index 615eb65c20..6374df30fb 100644 --- a/firmware/development/rfi_perftest.h +++ b/firmware/development/rfi_perftest.h @@ -5,11 +5,8 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef RFI_PERFTEST_H_ -#define RFI_PERFTEST_H_ +#pragma once #include "global.h" void initTimePerfActions(Logging *sharedLogger); - -#endif /* RFI_PERFTEST_H_ */ diff --git a/firmware/hw_layer/drivers/gpio/gpio_ext.h b/firmware/hw_layer/drivers/gpio/gpio_ext.h index 4d6b4eb927..8bb11263a7 100644 --- a/firmware/hw_layer/drivers/gpio/gpio_ext.h +++ b/firmware/hw_layer/drivers/gpio/gpio_ext.h @@ -7,8 +7,7 @@ * @author Andrey Gusakov, (c) 2019 */ -#ifndef GPIO_EXT_H_ -#define GPIO_EXT_H_ +#pragma once #if EFI_PROD_CODE #include "board.h" @@ -61,5 +60,3 @@ int gpiochips_get_total_pins(void); #ifdef __cplusplus } #endif - -#endif /* GPIO_EXT_H_ */ diff --git a/firmware/hw_layer/neo6m.h b/firmware/hw_layer/neo6m.h index da26342620..e21d1be952 100644 --- a/firmware/hw_layer/neo6m.h +++ b/firmware/hw_layer/neo6m.h @@ -7,8 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef NEO6M_H_ -#define NEO6M_H_ +#pragma once #ifdef __cplusplus extern "C" @@ -21,5 +20,3 @@ float getCurrentSpeed(void); #ifdef __cplusplus } #endif /* __cplusplus */ - -#endif /* NEO6M_H_ */ diff --git a/firmware/hw_layer/trigger_input.h b/firmware/hw_layer/trigger_input.h index 3a83f46f6b..bc2714b0d5 100644 --- a/firmware/hw_layer/trigger_input.h +++ b/firmware/hw_layer/trigger_input.h @@ -6,8 +6,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef CRANK_INPUT_H_ -#define CRANK_INPUT_H_ +#pragma once #include "engine.h" #include "pin_repository.h" @@ -20,5 +19,3 @@ void turnOnTriggerInputPins(Logging *sharedLogger); void applyNewTriggerInputPins(void); void startTriggerInputPins(void); void stopTriggerInputPins(void); - -#endif /* CRANK_INPUT_H_ */ diff --git a/firmware/hw_layer/vehicle_speed.h b/firmware/hw_layer/vehicle_speed.h index 504020d670..d0e84aae07 100644 --- a/firmware/hw_layer/vehicle_speed.h +++ b/firmware/hw_layer/vehicle_speed.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef HW_LAYER_VEHICLE_SPEED_H_ -#define HW_LAYER_VEHICLE_SPEED_H_ +#pragma once #include "global.h" @@ -19,5 +18,3 @@ void setMockVehicleSpeed(float speedKPH); bool hasVehicleSpeedSensor(); void stopVSSPins(void); void startVSSPins(void); - -#endif /* HW_LAYER_VEHICLE_SPEED_H_ */ diff --git a/firmware/os_access.h b/firmware/os_access.h index 39487685b0..36406f7606 100644 --- a/firmware/os_access.h +++ b/firmware/os_access.h @@ -7,8 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef OS_ACCESS_H_ -#define OS_ACCESS_H_ +#pragma once #ifdef __cplusplus extern "C" @@ -32,5 +31,3 @@ extern "C" EXTERNC int getRemainingStack(thread_t *otp); #define HAS_OS_ACCESS - -#endif /* OS_ACCESS_H_ */ diff --git a/firmware/util/cli_registry.h b/firmware/util/cli_registry.h index 6fddd12dc4..737f11b82c 100644 --- a/firmware/util/cli_registry.h +++ b/firmware/util/cli_registry.h @@ -6,8 +6,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef RFICONSOLE_LOGIC_H_ -#define RFICONSOLE_LOGIC_H_ +#pragma once #include "datalogging.h" #include "rusefi_types.h" @@ -85,5 +84,3 @@ void addConsoleActionSSSSS(const char *token, VoidCharPtrCharPtrCharPtrCharPtrCh #ifdef __cplusplus } #endif /* __cplusplus */ - -#endif /* RFICONSOLE_H_ */ diff --git a/firmware/util/containers/data_buffer.h b/firmware/util/containers/data_buffer.h index c484113552..6aedb0977a 100644 --- a/firmware/util/containers/data_buffer.h +++ b/firmware/util/containers/data_buffer.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef DATA_BUFFER_H_ -#define DATA_BUFFER_H_ +#pragma once #define DB_MAX_SIZE 1024 @@ -23,5 +22,3 @@ void dbAdd(data_buffer_s *db, int value); void dbCopy(data_buffer_s *source, data_buffer_s *target); void dbPrint(data_buffer_s *db, char *message, int withDiff); void dbPrintTable(data_buffer_s *table[], char *caption[], int columns); - -#endif /* DATA_BUFFER_H_ */ diff --git a/firmware/util/containers/fl_stack.h b/firmware/util/containers/fl_stack.h index 65b3668502..3950725677 100644 --- a/firmware/util/containers/fl_stack.h +++ b/firmware/util/containers/fl_stack.h @@ -6,8 +6,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef FL_STACK_H_ -#define FL_STACK_H_ +#pragma once #include "global.h" @@ -122,5 +121,3 @@ Type * ArrayList::add(void) { efiAssert(CUSTOM_ERR_ASSERT, size < Dimention, "add() too many elements", (Type *)NULL); return &elements[size++]; } - -#endif /* FL_STACK_H_ */ diff --git a/firmware/util/containers/listener_array.h b/firmware/util/containers/listener_array.h index b599ab3b64..5cad89f629 100644 --- a/firmware/util/containers/listener_array.h +++ b/firmware/util/containers/listener_array.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef LISTENER_ARRAY_H_ -#define LISTENER_ARRAY_H_ +#pragma once #include #include "rusefi_types.h" @@ -121,5 +120,3 @@ void clearCallbacks(IntListenerArray *array) { array->currentListenersCount = 0; } - -#endif /* LISTENER_ARRAY_H_ */ diff --git a/firmware/util/containers/local_version_holder.h b/firmware/util/containers/local_version_holder.h index 9bcb9f1b5b..bbfbf56da7 100644 --- a/firmware/util/containers/local_version_holder.h +++ b/firmware/util/containers/local_version_holder.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef LOCALVERSIONHOLDER_H_ -#define LOCALVERSIONHOLDER_H_ +#pragma once #include "stdbool.h" @@ -31,5 +30,3 @@ private: int localVersion = -1; }; - -#endif /* LOCALVERSIONHOLDER_H_ */ diff --git a/firmware/util/containers/table_helper.h b/firmware/util/containers/table_helper.h index 21a5499f83..2cd4368518 100644 --- a/firmware/util/containers/table_helper.h +++ b/firmware/util/containers/table_helper.h @@ -4,8 +4,8 @@ * @date Jul 6, 2014 * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef TABLE_HELPER_H_ -#define TABLE_HELPER_H_ + +#pragma once #include #include "error_handling.h" @@ -187,5 +187,3 @@ void setArrayValues(TValue (&array)[TSize], TValue value) { } void setRpmTableBin(float array[], int size); - -#endif /* TABLE_HELPER_H_ */ diff --git a/firmware/util/datalogging.h b/firmware/util/datalogging.h index 2c3ffc1fbc..feb691ea37 100644 --- a/firmware/util/datalogging.h +++ b/firmware/util/datalogging.h @@ -6,8 +6,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef DATALOGGING_H_ -#define DATALOGGING_H_ +#pragma once #include #include @@ -99,5 +98,3 @@ void scheduleLogging(Logging *logging); #endif /* __cplusplus */ void printWithLength(char *line); - -#endif /* DATALOGGING_H_ */ diff --git a/firmware/util/efilib.h b/firmware/util/efilib.h index 64ec350fb3..65fc71474e 100644 --- a/firmware/util/efilib.h +++ b/firmware/util/efilib.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef EFILIB_H_ -#define EFILIB_H_ +#pragma once #include @@ -123,5 +122,3 @@ constexpr void copyArrayPartial(TElement (&dest)[NDest], const TElement (&src)[N // "g++ -O0" or other C++/C compilers #define cisnan(f) (*(((int*) (&f))) == 0x7FC00000) #endif /* __cplusplus && __OPTIMIZE__ */ - -#endif /* EFILIB_H_ */ diff --git a/firmware/util/histogram.h b/firmware/util/histogram.h index 2c3769d8b3..c4e87bc820 100644 --- a/firmware/util/histogram.h +++ b/firmware/util/histogram.h @@ -13,8 +13,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef HISTOGRAM_H_ -#define HISTOGRAM_H_ +#pragma once #ifdef __cplusplus extern "C" @@ -41,6 +40,3 @@ int hsReport(histogram_s *h, int* report); #ifdef __cplusplus } #endif /* __cplusplus */ - - -#endif /* HISTOGRAM_H_ */ diff --git a/firmware/util/loggingcentral.h b/firmware/util/loggingcentral.h index b3797a3acf..013677f79c 100644 --- a/firmware/util/loggingcentral.h +++ b/firmware/util/loggingcentral.h @@ -4,13 +4,10 @@ * @date Mar 8, 2015 * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef UTIL_LOGGINGCENTRAL_H_ -#define UTIL_LOGGINGCENTRAL_H_ +#pragma once class Logging; void initLoggingCentral(void); char * swapOutputBuffers(int *actualOutputBufferSize); void scheduleMsg(Logging *logging, const char *fmt, ...); - -#endif /* UTIL_LOGGINGCENTRAL_H_ */ diff --git a/firmware/util/math/avg_values.h b/firmware/util/math/avg_values.h index 69568454f1..c7e4133662 100644 --- a/firmware/util/math/avg_values.h +++ b/firmware/util/math/avg_values.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef AVG_VALUES_H_ -#define AVG_VALUES_H_ +#pragma once #define AVG_TAB_SIZE 48 @@ -26,5 +25,3 @@ void avgAddValue(AvgTable *table, int rpm, float key, float value); float avgGetValueByIndexes(AvgTable *table, int i, int j); float avgGetValue(AvgTable *table, int rpm, float key); int avgGetValuesCount(AvgTable *table, int rpm, float key); - -#endif /* AVG_VALUES_H_ */ diff --git a/firmware/util/math/biquad.h b/firmware/util/math/biquad.h index 38209bfa5f..d22d2a80dd 100644 --- a/firmware/util/math/biquad.h +++ b/firmware/util/math/biquad.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef CONTROLLERS_MATH_BIQUAD_H_ -#define CONTROLLERS_MATH_BIQUAD_H_ +#pragma once // todo: narrow this dependency further? only 'bi_quard_s' is needed, should it be extracted / moved to a smaller header? // todo: do we need to make code generation smarted and produce a larger number of smaller headers instead of one monster header? @@ -21,5 +20,3 @@ public: float a0, a1, a2, b1, b2; float z1, z2; }; - -#endif /* CONTROLLERS_MATH_BIQUAD_H_ */ diff --git a/firmware/util/math/crc.h b/firmware/util/math/crc.h index 0b6693da35..7e8d647548 100644 --- a/firmware/util/math/crc.h +++ b/firmware/util/math/crc.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef CRC_H_ -#define CRC_H_ +#pragma once #include "stdint.h" @@ -23,5 +22,3 @@ uint32_t crc32inc(const void *buf, uint32_t crc, uint32_t size); #ifdef __cplusplus } #endif /* __cplusplus */ - -#endif /* CRC_H_ */ diff --git a/firmware/util/math/interpolation.h b/firmware/util/math/interpolation.h index 3322f89bd9..4d03a89e6a 100644 --- a/firmware/util/math/interpolation.h +++ b/firmware/util/math/interpolation.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef INTERPOLATION_3D_H_ -#define INTERPOLATION_3D_H_ +#pragma once #include #include "datalogging.h" @@ -243,5 +242,3 @@ public: private: float a, b; }; - -#endif /* INTERPOLATION_3D_H_ */ diff --git a/firmware/util/math/pid.h b/firmware/util/math/pid.h index 36c7f3bf45..ad7360a249 100644 --- a/firmware/util/math/pid.h +++ b/firmware/util/math/pid.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef PID_H_ -#define PID_H_ +#pragma once #include "engine_state_generated.h" #include "pid_state_generated.h" @@ -128,5 +127,3 @@ public: private: float limitOutput(float v) const; }; - -#endif /* PID_H_ */ diff --git a/firmware/util/math/signal_filtering.h b/firmware/util/math/signal_filtering.h index 7543eb9fe8..01df176e19 100644 --- a/firmware/util/math/signal_filtering.h +++ b/firmware/util/math/signal_filtering.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef SIGNAL_FILTERING_H_ -#define SIGNAL_FILTERING_H_ +#pragma once #define FILTER_SIZE 5 @@ -21,5 +20,3 @@ void sfInit(SignalFiltering *fs, float K, float initialValue); void sfAddValue(SignalFiltering *fs, float value); void sfAddValue2(SignalFiltering *fs, float value); float sfGetValue(SignalFiltering *fs); - -#endif /* SIGNAL_FILTERING_H_ */ diff --git a/firmware/util/os_util.h b/firmware/util/os_util.h index 207461909e..3124dc599e 100644 --- a/firmware/util/os_util.h +++ b/firmware/util/os_util.h @@ -6,8 +6,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef RFIUTIL_H_ -#define RFIUTIL_H_ +#pragma once #include "global.h" @@ -42,6 +41,3 @@ void printHistogram(Logging *logging, histogram_s *histogram); #endif /* __cplusplus */ #endif /* EFI_UNIT_TEST */ - -#endif /* RFIUTIL_H_ */ - diff --git a/firmware/util/rusefi_true.h b/firmware/util/rusefi_true.h index d6c2f00346..376bcc32a2 100644 --- a/firmware/util/rusefi_true.h +++ b/firmware/util/rusefi_true.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef CONTROLLERS_ALGO_RUSEFI_TRUE_H_ -#define CONTROLLERS_ALGO_RUSEFI_TRUE_H_ +#pragma once // we still have a minor mess with headers, this header should better be included as high as possible @@ -17,5 +16,3 @@ #ifndef TRUE #define TRUE (!(FALSE)) #endif /* TRUE */ - -#endif /* CONTROLLERS_ALGO_RUSEFI_TRUE_H_ */ diff --git a/unit_tests/adc_inputs.h b/unit_tests/adc_inputs.h index 80bf095932..b31e410367 100644 --- a/unit_tests/adc_inputs.h +++ b/unit_tests/adc_inputs.h @@ -5,9 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef ADC_INPUTS_H_ -#define ADC_INPUTS_H_ +#pragma once #include "boards.h" - -#endif /* ADC_INPUTS_H_ */ diff --git a/unit_tests/afm2mapConverter.h b/unit_tests/afm2mapConverter.h index 05400bdf75..3a3dd5eb5d 100644 --- a/unit_tests/afm2mapConverter.h +++ b/unit_tests/afm2mapConverter.h @@ -5,9 +5,6 @@ * @date Jan 20, 2018 */ -#ifndef AFM2MAPCONVERTER_H_ -#define AFM2MAPCONVERTER_H_ +#pragma once void printConvertedTable(); - -#endif /* AFM2MAPCONVERTER_H_ */ diff --git a/unit_tests/efifeatures.h b/unit_tests/efifeatures.h index c7c1fe99e1..b38f006a4d 100644 --- a/unit_tests/efifeatures.h +++ b/unit_tests/efifeatures.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef EFIFEATURES_H_ -#define EFIFEATURES_H_ +#pragma once #include "rusefi_true.h" @@ -70,5 +69,3 @@ #define EFI_JOYSTICK FALSE #define EFI_MAP_AVERAGING TRUE - -#endif /* EFIFEATURES_H_ */ diff --git a/unit_tests/global_execution_queue.h b/unit_tests/global_execution_queue.h index b1e341d741..f568ad9954 100644 --- a/unit_tests/global_execution_queue.h +++ b/unit_tests/global_execution_queue.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef GLOBAL_EXECUTION_QUEUE_H_ -#define GLOBAL_EXECUTION_QUEUE_H_ +#pragma once #include "scheduler.h" #include "event_queue.h" @@ -23,5 +22,3 @@ public: private: EventQueue schedulingQueue; }; - -#endif /* GLOBAL_EXECUTION_QUEUE_H_ */ diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index 20a0d9a248..bf659906ba 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -9,7 +9,6 @@ #include #include "global.h" -#include "test_interpolation_3d.h" #include "test_find_index.h" #include "engine_configuration.h" diff --git a/unit_tests/map_resize.h b/unit_tests/map_resize.h index 9c2c043e91..102502aa83 100644 --- a/unit_tests/map_resize.h +++ b/unit_tests/map_resize.h @@ -5,9 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef MAP_RESIZE_H_ -#define MAP_RESIZE_H_ +#pragma once void resizeMap(void); - -#endif /* MAP_RESIZE_H_ */ diff --git a/unit_tests/os_access.h b/unit_tests/os_access.h index 60e1de3860..aaa3b76b00 100644 --- a/unit_tests/os_access.h +++ b/unit_tests/os_access.h @@ -7,7 +7,3 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef OS_ACCESS_H_ -#define OS_ACCESS_H_ - -#endif /* OS_ACCESS_H_ */ diff --git a/unit_tests/settings.h b/unit_tests/settings.h deleted file mode 100644 index 31327e150e..0000000000 --- a/unit_tests/settings.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file settings.h - * - * @date Feb 13, 2014 - * @author Andrey Belomutskiy, (c) 2012-2014 - */ - -#ifndef SETTINGS_H_ -#define SETTINGS_H_ - - - -#endif /* SETTINGS_H_ */ diff --git a/unit_tests/test_basic_math/test_find_index.h b/unit_tests/test_basic_math/test_find_index.h index 3f9fcf1ed6..850649e01c 100644 --- a/unit_tests/test_basic_math/test_find_index.h +++ b/unit_tests/test_basic_math/test_find_index.h @@ -5,9 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef TEST_FIND_INDEX_H_ -#define TEST_FIND_INDEX_H_ +#pragma once void testFindIndex(void); - -#endif /* TEST_FIND_INDEX_H_ */ diff --git a/unit_tests/test_basic_math/test_interpolation_3d.cpp b/unit_tests/test_basic_math/test_interpolation_3d.cpp index 2dc909935a..1e03d5cc4e 100644 --- a/unit_tests/test_basic_math/test_interpolation_3d.cpp +++ b/unit_tests/test_basic_math/test_interpolation_3d.cpp @@ -5,7 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#include "test_interpolation_3d.h" #include #include "interpolation.h" diff --git a/unit_tests/test_basic_math/test_interpolation_3d.h b/unit_tests/test_basic_math/test_interpolation_3d.h deleted file mode 100644 index 0528c36db8..0000000000 --- a/unit_tests/test_basic_math/test_interpolation_3d.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Created on: Oct 17, 2013 - * Author: Andrey Belomutskiy, (c) 2012-2015 - */ - -/** - * @file test_interpolation_3d.h - */ - - -#ifndef TEST_INTERPOLATION_3D_H_ -#define TEST_INTERPOLATION_3D_H_ - - -#endif /* TEST_INTERPOLATION_3D_H_ */ diff --git a/unit_tests/tests/test_parameters.h b/unit_tests/tests/test_parameters.h index 24d8ce7e62..dd4013a41c 100644 --- a/unit_tests/tests/test_parameters.h +++ b/unit_tests/tests/test_parameters.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef TESTS_TEST_PARAMETERS_H_ -#define TESTS_TEST_PARAMETERS_H_ +#pragma once #include using namespace std; @@ -18,4 +17,3 @@ public: float get(string key) const; }; -#endif /* TESTS_TEST_PARAMETERS_H_ */ diff --git a/unit_tests/tests/test_signal_executor.h b/unit_tests/tests/test_signal_executor.h index a57093fb87..e38f1c9c9d 100644 --- a/unit_tests/tests/test_signal_executor.h +++ b/unit_tests/tests/test_signal_executor.h @@ -5,9 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef TEST_SIGNAL_EXECUTOR_H_ -#define TEST_SIGNAL_EXECUTOR_H_ +#pragma once int getRevolutionCounter(); - -#endif /* TEST_SIGNAL_EXECUTOR_H_ */