code style

This commit is contained in:
rusefi 2020-04-01 21:32:21 -04:00
parent f3ab4d81f7
commit b40d4d588d
37 changed files with 33 additions and 163 deletions

View File

@ -5,11 +5,8 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef RFI_PERFTEST_H_ #pragma once
#define RFI_PERFTEST_H_
#include "global.h" #include "global.h"
void initTimePerfActions(Logging *sharedLogger); void initTimePerfActions(Logging *sharedLogger);
#endif /* RFI_PERFTEST_H_ */

View File

@ -7,8 +7,7 @@
* @author Andrey Gusakov, (c) 2019 * @author Andrey Gusakov, (c) 2019
*/ */
#ifndef GPIO_EXT_H_ #pragma once
#define GPIO_EXT_H_
#if EFI_PROD_CODE #if EFI_PROD_CODE
#include "board.h" #include "board.h"
@ -61,5 +60,3 @@ int gpiochips_get_total_pins(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* GPIO_EXT_H_ */

View File

@ -7,8 +7,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef NEO6M_H_ #pragma once
#define NEO6M_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
@ -21,5 +20,3 @@ float getCurrentSpeed(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* NEO6M_H_ */

View File

@ -6,8 +6,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef CRANK_INPUT_H_ #pragma once
#define CRANK_INPUT_H_
#include "engine.h" #include "engine.h"
#include "pin_repository.h" #include "pin_repository.h"
@ -20,5 +19,3 @@ void turnOnTriggerInputPins(Logging *sharedLogger);
void applyNewTriggerInputPins(void); void applyNewTriggerInputPins(void);
void startTriggerInputPins(void); void startTriggerInputPins(void);
void stopTriggerInputPins(void); void stopTriggerInputPins(void);
#endif /* CRANK_INPUT_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef HW_LAYER_VEHICLE_SPEED_H_ #pragma once
#define HW_LAYER_VEHICLE_SPEED_H_
#include "global.h" #include "global.h"
@ -19,5 +18,3 @@ void setMockVehicleSpeed(float speedKPH);
bool hasVehicleSpeedSensor(); bool hasVehicleSpeedSensor();
void stopVSSPins(void); void stopVSSPins(void);
void startVSSPins(void); void startVSSPins(void);
#endif /* HW_LAYER_VEHICLE_SPEED_H_ */

View File

@ -7,8 +7,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef OS_ACCESS_H_ #pragma once
#define OS_ACCESS_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
@ -32,5 +31,3 @@ extern "C"
EXTERNC int getRemainingStack(thread_t *otp); EXTERNC int getRemainingStack(thread_t *otp);
#define HAS_OS_ACCESS #define HAS_OS_ACCESS
#endif /* OS_ACCESS_H_ */

View File

@ -6,8 +6,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef RFICONSOLE_LOGIC_H_ #pragma once
#define RFICONSOLE_LOGIC_H_
#include "datalogging.h" #include "datalogging.h"
#include "rusefi_types.h" #include "rusefi_types.h"
@ -85,5 +84,3 @@ void addConsoleActionSSSSS(const char *token, VoidCharPtrCharPtrCharPtrCharPtrCh
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* RFICONSOLE_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef DATA_BUFFER_H_ #pragma once
#define DATA_BUFFER_H_
#define DB_MAX_SIZE 1024 #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 dbCopy(data_buffer_s *source, data_buffer_s *target);
void dbPrint(data_buffer_s *db, char *message, int withDiff); void dbPrint(data_buffer_s *db, char *message, int withDiff);
void dbPrintTable(data_buffer_s *table[], char *caption[], int columns); void dbPrintTable(data_buffer_s *table[], char *caption[], int columns);
#endif /* DATA_BUFFER_H_ */

View File

@ -6,8 +6,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef FL_STACK_H_ #pragma once
#define FL_STACK_H_
#include "global.h" #include "global.h"
@ -122,5 +121,3 @@ Type * ArrayList<Type, Dimention>::add(void) {
efiAssert(CUSTOM_ERR_ASSERT, size < Dimention, "add() too many elements", (Type *)NULL); efiAssert(CUSTOM_ERR_ASSERT, size < Dimention, "add() too many elements", (Type *)NULL);
return &elements[size++]; return &elements[size++];
} }
#endif /* FL_STACK_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef LISTENER_ARRAY_H_ #pragma once
#define LISTENER_ARRAY_H_
#include <stddef.h> #include <stddef.h>
#include "rusefi_types.h" #include "rusefi_types.h"
@ -121,5 +120,3 @@ void clearCallbacks(IntListenerArray<MAX_INT_LISTENER_COUNT> *array) {
array->currentListenersCount = 0; array->currentListenersCount = 0;
} }
#endif /* LISTENER_ARRAY_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef LOCALVERSIONHOLDER_H_ #pragma once
#define LOCALVERSIONHOLDER_H_
#include "stdbool.h" #include "stdbool.h"
@ -31,5 +30,3 @@ private:
int localVersion = -1; int localVersion = -1;
}; };
#endif /* LOCALVERSIONHOLDER_H_ */

View File

@ -4,8 +4,8 @@
* @date Jul 6, 2014 * @date Jul 6, 2014
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef TABLE_HELPER_H_
#define TABLE_HELPER_H_ #pragma once
#include <math.h> #include <math.h>
#include "error_handling.h" #include "error_handling.h"
@ -187,5 +187,3 @@ void setArrayValues(TValue (&array)[TSize], TValue value) {
} }
void setRpmTableBin(float array[], int size); void setRpmTableBin(float array[], int size);
#endif /* TABLE_HELPER_H_ */

View File

@ -6,8 +6,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef DATALOGGING_H_ #pragma once
#define DATALOGGING_H_
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
@ -99,5 +98,3 @@ void scheduleLogging(Logging *logging);
#endif /* __cplusplus */ #endif /* __cplusplus */
void printWithLength(char *line); void printWithLength(char *line);
#endif /* DATALOGGING_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef EFILIB_H_ #pragma once
#define EFILIB_H_
#include <stdint.h> #include <stdint.h>
@ -123,5 +122,3 @@ constexpr void copyArrayPartial(TElement (&dest)[NDest], const TElement (&src)[N
// "g++ -O0" or other C++/C compilers // "g++ -O0" or other C++/C compilers
#define cisnan(f) (*(((int*) (&f))) == 0x7FC00000) #define cisnan(f) (*(((int*) (&f))) == 0x7FC00000)
#endif /* __cplusplus && __OPTIMIZE__ */ #endif /* __cplusplus && __OPTIMIZE__ */
#endif /* EFILIB_H_ */

View File

@ -13,8 +13,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef HISTOGRAM_H_ #pragma once
#define HISTOGRAM_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
@ -41,6 +40,3 @@ int hsReport(histogram_s *h, int* report);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* HISTOGRAM_H_ */

View File

@ -4,13 +4,10 @@
* @date Mar 8, 2015 * @date Mar 8, 2015
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef UTIL_LOGGINGCENTRAL_H_ #pragma once
#define UTIL_LOGGINGCENTRAL_H_
class Logging; class Logging;
void initLoggingCentral(void); void initLoggingCentral(void);
char * swapOutputBuffers(int *actualOutputBufferSize); char * swapOutputBuffers(int *actualOutputBufferSize);
void scheduleMsg(Logging *logging, const char *fmt, ...); void scheduleMsg(Logging *logging, const char *fmt, ...);
#endif /* UTIL_LOGGINGCENTRAL_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef AVG_VALUES_H_ #pragma once
#define AVG_VALUES_H_
#define AVG_TAB_SIZE 48 #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 avgGetValueByIndexes(AvgTable *table, int i, int j);
float avgGetValue(AvgTable *table, int rpm, float key); float avgGetValue(AvgTable *table, int rpm, float key);
int avgGetValuesCount(AvgTable *table, int rpm, float key); int avgGetValuesCount(AvgTable *table, int rpm, float key);
#endif /* AVG_VALUES_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef CONTROLLERS_MATH_BIQUAD_H_ #pragma once
#define CONTROLLERS_MATH_BIQUAD_H_
// todo: narrow this dependency further? only 'bi_quard_s' is needed, should it be extracted / moved to a smaller header? // 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? // 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 a0, a1, a2, b1, b2;
float z1, z2; float z1, z2;
}; };
#endif /* CONTROLLERS_MATH_BIQUAD_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef CRC_H_ #pragma once
#define CRC_H_
#include "stdint.h" #include "stdint.h"
@ -23,5 +22,3 @@ uint32_t crc32inc(const void *buf, uint32_t crc, uint32_t size);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* CRC_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef INTERPOLATION_3D_H_ #pragma once
#define INTERPOLATION_3D_H_
#include <math.h> #include <math.h>
#include "datalogging.h" #include "datalogging.h"
@ -243,5 +242,3 @@ public:
private: private:
float a, b; float a, b;
}; };
#endif /* INTERPOLATION_3D_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef PID_H_ #pragma once
#define PID_H_
#include "engine_state_generated.h" #include "engine_state_generated.h"
#include "pid_state_generated.h" #include "pid_state_generated.h"
@ -128,5 +127,3 @@ public:
private: private:
float limitOutput(float v) const; float limitOutput(float v) const;
}; };
#endif /* PID_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef SIGNAL_FILTERING_H_ #pragma once
#define SIGNAL_FILTERING_H_
#define FILTER_SIZE 5 #define FILTER_SIZE 5
@ -21,5 +20,3 @@ void sfInit(SignalFiltering *fs, float K, float initialValue);
void sfAddValue(SignalFiltering *fs, float value); void sfAddValue(SignalFiltering *fs, float value);
void sfAddValue2(SignalFiltering *fs, float value); void sfAddValue2(SignalFiltering *fs, float value);
float sfGetValue(SignalFiltering *fs); float sfGetValue(SignalFiltering *fs);
#endif /* SIGNAL_FILTERING_H_ */

View File

@ -6,8 +6,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef RFIUTIL_H_ #pragma once
#define RFIUTIL_H_
#include "global.h" #include "global.h"
@ -42,6 +41,3 @@ void printHistogram(Logging *logging, histogram_s *histogram);
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* EFI_UNIT_TEST */ #endif /* EFI_UNIT_TEST */
#endif /* RFIUTIL_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef CONTROLLERS_ALGO_RUSEFI_TRUE_H_ #pragma once
#define CONTROLLERS_ALGO_RUSEFI_TRUE_H_
// we still have a minor mess with headers, this header should better be included as high as possible // we still have a minor mess with headers, this header should better be included as high as possible
@ -17,5 +16,3 @@
#ifndef TRUE #ifndef TRUE
#define TRUE (!(FALSE)) #define TRUE (!(FALSE))
#endif /* TRUE */ #endif /* TRUE */
#endif /* CONTROLLERS_ALGO_RUSEFI_TRUE_H_ */

View File

@ -5,9 +5,6 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef ADC_INPUTS_H_ #pragma once
#define ADC_INPUTS_H_
#include "boards.h" #include "boards.h"
#endif /* ADC_INPUTS_H_ */

View File

@ -5,9 +5,6 @@
* @date Jan 20, 2018 * @date Jan 20, 2018
*/ */
#ifndef AFM2MAPCONVERTER_H_ #pragma once
#define AFM2MAPCONVERTER_H_
void printConvertedTable(); void printConvertedTable();
#endif /* AFM2MAPCONVERTER_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef EFIFEATURES_H_ #pragma once
#define EFIFEATURES_H_
#include "rusefi_true.h" #include "rusefi_true.h"
@ -70,5 +69,3 @@
#define EFI_JOYSTICK FALSE #define EFI_JOYSTICK FALSE
#define EFI_MAP_AVERAGING TRUE #define EFI_MAP_AVERAGING TRUE
#endif /* EFIFEATURES_H_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef GLOBAL_EXECUTION_QUEUE_H_ #pragma once
#define GLOBAL_EXECUTION_QUEUE_H_
#include "scheduler.h" #include "scheduler.h"
#include "event_queue.h" #include "event_queue.h"
@ -23,5 +22,3 @@ public:
private: private:
EventQueue schedulingQueue; EventQueue schedulingQueue;
}; };
#endif /* GLOBAL_EXECUTION_QUEUE_H_ */

View File

@ -9,7 +9,6 @@
#include <stdlib.h> #include <stdlib.h>
#include "global.h" #include "global.h"
#include "test_interpolation_3d.h"
#include "test_find_index.h" #include "test_find_index.h"
#include "engine_configuration.h" #include "engine_configuration.h"

View File

@ -5,9 +5,6 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef MAP_RESIZE_H_ #pragma once
#define MAP_RESIZE_H_
void resizeMap(void); void resizeMap(void);
#endif /* MAP_RESIZE_H_ */

View File

@ -7,7 +7,3 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef OS_ACCESS_H_
#define OS_ACCESS_H_
#endif /* OS_ACCESS_H_ */

View File

@ -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_ */

View File

@ -5,9 +5,6 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef TEST_FIND_INDEX_H_ #pragma once
#define TEST_FIND_INDEX_H_
void testFindIndex(void); void testFindIndex(void);
#endif /* TEST_FIND_INDEX_H_ */

View File

@ -5,7 +5,6 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#include "test_interpolation_3d.h"
#include <stdlib.h> #include <stdlib.h>
#include "interpolation.h" #include "interpolation.h"

View File

@ -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_ */

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef TESTS_TEST_PARAMETERS_H_ #pragma once
#define TESTS_TEST_PARAMETERS_H_
#include <unordered_map> #include <unordered_map>
using namespace std; using namespace std;
@ -18,4 +17,3 @@ public:
float get(string key) const; float get(string key) const;
}; };
#endif /* TESTS_TEST_PARAMETERS_H_ */

View File

@ -5,9 +5,6 @@
* @author Andrey Belomutskiy, (c) 2012-2020 * @author Andrey Belomutskiy, (c) 2012-2020
*/ */
#ifndef TEST_SIGNAL_EXECUTOR_H_ #pragma once
#define TEST_SIGNAL_EXECUTOR_H_
int getRevolutionCounter(); int getRevolutionCounter();
#endif /* TEST_SIGNAL_EXECUTOR_H_ */