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
*/
#ifndef RFI_PERFTEST_H_
#define RFI_PERFTEST_H_
#pragma once
#include "global.h"
void initTimePerfActions(Logging *sharedLogger);
#endif /* RFI_PERFTEST_H_ */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<Type, Dimention>::add(void) {
efiAssert(CUSTOM_ERR_ASSERT, size < Dimention, "add() too many elements", (Type *)NULL);
return &elements[size++];
}
#endif /* FL_STACK_H_ */

View File

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

View File

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

View File

@ -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 <math.h>
#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_ */

View File

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

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#ifndef EFILIB_H_
#define EFILIB_H_
#pragma once
#include <stdint.h>
@ -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_ */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,3 @@
* @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
*/
#ifndef TEST_FIND_INDEX_H_
#define TEST_FIND_INDEX_H_
#pragma once
void testFindIndex(void);
#endif /* TEST_FIND_INDEX_H_ */

View File

@ -5,7 +5,6 @@
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "test_interpolation_3d.h"
#include <stdlib.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
*/
#ifndef TESTS_TEST_PARAMETERS_H_
#define TESTS_TEST_PARAMETERS_H_
#pragma once
#include <unordered_map>
using namespace std;
@ -18,4 +17,3 @@ public:
float get(string key) const;
};
#endif /* TESTS_TEST_PARAMETERS_H_ */

View File

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