From 83b1ca00a456333f7da7f1d9108a4bc9f0a7291f Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 21 Jan 2020 01:40:11 -0500 Subject: [PATCH] code style --- firmware/controllers/sensors/allsensors.h | 4 +--- firmware/controllers/sensors/ego.h | 5 +---- firmware/controllers/sensors/hip9011_lookup.h | 5 ++--- firmware/controllers/sensors/maf.h | 4 +--- firmware/controllers/sensors/maf2map.h | 5 +---- firmware/controllers/sensors/map.h | 5 ++--- firmware/controllers/sensors/thermistors.h | 4 +--- firmware/controllers/sensors/tps.h | 5 ++--- firmware/controllers/sensors/voltage.h | 5 +---- firmware/controllers/system/timer/event_queue.h | 4 +--- firmware/controllers/system/timer/pwm_generator_logic.h | 4 +--- firmware/controllers/system/timer/signal_executor_sleep.h | 5 +---- firmware/controllers/system/timer/single_timer_executor.h | 4 +--- firmware/controllers/trigger/trigger_emulator_algo.h | 4 +--- firmware/util/efitime.h | 5 +---- 15 files changed, 18 insertions(+), 50 deletions(-) diff --git a/firmware/controllers/sensors/allsensors.h b/firmware/controllers/sensors/allsensors.h index e7e0acc9c7..280e482905 100644 --- a/firmware/controllers/sensors/allsensors.h +++ b/firmware/controllers/sensors/allsensors.h @@ -10,8 +10,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef SENSORS_H_ -#define SENSORS_H_ +#pragma once #include "tps.h" #include "map.h" @@ -26,4 +25,3 @@ void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); bool hasAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE); bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE); -#endif /*SENSORS_H_*/ diff --git a/firmware/controllers/sensors/ego.h b/firmware/controllers/sensors/ego.h index e204c7c06d..ef1cf42bc5 100644 --- a/firmware/controllers/sensors/ego.h +++ b/firmware/controllers/sensors/ego.h @@ -7,8 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef EGO_H_ -#define EGO_H_ +#pragma once #include "global.h" #include "engine_configuration.h" @@ -17,5 +16,3 @@ float getAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE); bool hasAfrSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE); void setEgoSensor(ego_sensor_e type DECLARE_CONFIG_PARAMETER_SUFFIX); void initEgoAveraging(DECLARE_ENGINE_PARAMETER_SIGNATURE); - -#endif diff --git a/firmware/controllers/sensors/hip9011_lookup.h b/firmware/controllers/sensors/hip9011_lookup.h index de5db7024f..538bcc067e 100644 --- a/firmware/controllers/sensors/hip9011_lookup.h +++ b/firmware/controllers/sensors/hip9011_lookup.h @@ -4,8 +4,8 @@ * @date Jan 4, 2015 * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef CONTROLLERS_SENSORS_HIP9011_LOOKUP_H_ -#define CONTROLLERS_SENSORS_HIP9011_LOOKUP_H_ + +#pragma once #include "engine.h" @@ -29,4 +29,3 @@ int getHip9011BandIndex(float frequency); extern float rpmLookup[INT_LOOKUP_SIZE]; void initEngineNoiseTable(DECLARE_ENGINE_PARAMETER_SIGNATURE); -#endif /* CONTROLLERS_SENSORS_HIP9011_LOOKUP_H_ */ diff --git a/firmware/controllers/sensors/maf.h b/firmware/controllers/sensors/maf.h index d3cbe770a0..2ea39b4efa 100644 --- a/firmware/controllers/sensors/maf.h +++ b/firmware/controllers/sensors/maf.h @@ -9,8 +9,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef MAF_H_ -#define MAF_H_ +#pragma once #include "global.h" @@ -24,4 +23,3 @@ void setBosch0280218004(persistent_config_s *engineConfiguration); void setDensoTODO(persistent_config_s *engineConfiguration); void setMazdaMiataNAMaf(persistent_config_s *e); -#endif diff --git a/firmware/controllers/sensors/maf2map.h b/firmware/controllers/sensors/maf2map.h index 90d48d9b74..a9a3cada73 100644 --- a/firmware/controllers/sensors/maf2map.h +++ b/firmware/controllers/sensors/maf2map.h @@ -5,8 +5,7 @@ * @date Jan 20, 2018 */ -#ifndef CONTROLLERS_SENSORS_MAF2MAP_H_ -#define CONTROLLERS_SENSORS_MAF2MAP_H_ +#pragma once #include "table_helper.h" @@ -16,5 +15,3 @@ typedef Map3D maf2map_Map3D_t; void initMaf2Map(); float estimateMapByRpmAndMaf(int rpm, float maf); - -#endif /* CONTROLLERS_SENSORS_MAF2MAP_H_ */ diff --git a/firmware/controllers/sensors/map.h b/firmware/controllers/sensors/map.h index d701f6a4c6..0caddf942d 100644 --- a/firmware/controllers/sensors/map.h +++ b/firmware/controllers/sensors/map.h @@ -3,8 +3,8 @@ * * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef MAP_H_ -#define MAP_H_ + +#pragma once #include "engine_configuration.h" @@ -34,4 +34,3 @@ float validateMap(float mapKPa DECLARE_ENGINE_PARAMETER_SUFFIX); #define INHG2KPA(inhg) ((inhg) * 3.386375) #define KPA2INHG(kpa) ((kpa) / 3.386375) -#endif diff --git a/firmware/controllers/sensors/thermistors.h b/firmware/controllers/sensors/thermistors.h index 3fd8b47c25..79e1cf5ce0 100644 --- a/firmware/controllers/sensors/thermistors.h +++ b/firmware/controllers/sensors/thermistors.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef THERMISTORS_H_ -#define THERMISTORS_H_ +#pragma once #include "global.h" @@ -56,4 +55,3 @@ void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup); void setDodgeSensor(ThermistorConf *thermistorConf, float pullup); void set10K_4050K(ThermistorConf *thermistorConf, float pullup); -#endif /* THERMISTORS_H_ */ diff --git a/firmware/controllers/sensors/tps.h b/firmware/controllers/sensors/tps.h index b802bd96d7..9cf8b731a0 100644 --- a/firmware/controllers/sensors/tps.h +++ b/firmware/controllers/sensors/tps.h @@ -7,8 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef TPS_H_ -#define TPS_H_ +#pragma once #include "global.h" #include "engine_configuration.h" @@ -55,4 +54,4 @@ typedef struct { //void saveTpsState(efitimeus_t now, float curValue); float getTpsRateOfChange(void); -#endif + diff --git a/firmware/controllers/sensors/voltage.h b/firmware/controllers/sensors/voltage.h index 28177b4c49..be1e3859d3 100644 --- a/firmware/controllers/sensors/voltage.h +++ b/firmware/controllers/sensors/voltage.h @@ -7,8 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef VOLTAGE_H_ -#define VOLTAGE_H_ +#pragma once #include "global.h" #include "engine_configuration.h" @@ -16,5 +15,3 @@ float getVRef(DECLARE_ENGINE_PARAMETER_SIGNATURE); float getVBatt(DECLARE_ENGINE_PARAMETER_SIGNATURE); bool hasVBatt(DECLARE_ENGINE_PARAMETER_SIGNATURE); - -#endif diff --git a/firmware/controllers/system/timer/event_queue.h b/firmware/controllers/system/timer/event_queue.h index 8a3155d900..421e7dac01 100644 --- a/firmware/controllers/system/timer/event_queue.h +++ b/firmware/controllers/system/timer/event_queue.h @@ -8,8 +8,7 @@ #include "scheduler.h" #include "utlist.h" -#ifndef EVENT_SCHEDULER_H_ -#define EVENT_SCHEDULER_H_ +#pragma once /** * this is a large value which is expected to be larger than any real time @@ -71,4 +70,3 @@ private: efitime_t lateDelay; }; -#endif /* EVENT_SCHEDULER_H_ */ diff --git a/firmware/controllers/system/timer/pwm_generator_logic.h b/firmware/controllers/system/timer/pwm_generator_logic.h index 86a27f0bae..182cc9d27b 100644 --- a/firmware/controllers/system/timer/pwm_generator_logic.h +++ b/firmware/controllers/system/timer/pwm_generator_logic.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef PWM_GENERATOR_LOGIC_H_ -#define PWM_GENERATOR_LOGIC_H_ +#pragma once #include "state_sequence.h" #include "global.h" @@ -150,4 +149,3 @@ void startSimplePwmExt(SimplePwm *state, void copyPwmParameters(PwmConfig *state, int phaseCount, float const *switchTimes, int waveCount, pin_state_t *const *pinStates); -#endif /* PWM_GENERATOR_LOGIC_H_ */ diff --git a/firmware/controllers/system/timer/signal_executor_sleep.h b/firmware/controllers/system/timer/signal_executor_sleep.h index 090d4149bc..25f3ed1869 100644 --- a/firmware/controllers/system/timer/signal_executor_sleep.h +++ b/firmware/controllers/system/timer/signal_executor_sleep.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef SIGNAL_EXECUTOR_SLEEP_H_ -#define SIGNAL_EXECUTOR_SLEEP_H_ +#pragma once #include "scheduler.h" @@ -16,5 +15,3 @@ public: void scheduleByTimestampNt(scheduling_s *scheduling, efitick_t timeNt, action_s action) override; void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) override; }; - -#endif /* SIGNAL_EXECUTOR_SLEEP_H_ */ diff --git a/firmware/controllers/system/timer/single_timer_executor.h b/firmware/controllers/system/timer/single_timer_executor.h index 39efa70598..28daef418f 100644 --- a/firmware/controllers/system/timer/single_timer_executor.h +++ b/firmware/controllers/system/timer/single_timer_executor.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef SINGLETIMEREXECUTOR_H_ -#define SINGLETIMEREXECUTOR_H_ +#pragma once #include "scheduler.h" #include "event_queue.h" @@ -31,4 +30,3 @@ private: void initSingleTimerExecutorHardware(void); void executorStatistics(); -#endif /* SINGLETIMEREXECUTOR_H_ */ diff --git a/firmware/controllers/trigger/trigger_emulator_algo.h b/firmware/controllers/trigger/trigger_emulator_algo.h index d88031337f..a143e93cc8 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.h +++ b/firmware/controllers/trigger/trigger_emulator_algo.h @@ -5,8 +5,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef TRIGGER_EMULATOR_ALGO_H_ -#define TRIGGER_EMULATOR_ALGO_H_ +#pragma once #include "engine.h" #include "pwm_generator_logic.h" @@ -22,4 +21,3 @@ void initTriggerEmulatorLogic(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUF int getPreviousIndex(const int currentIndex, const int size); bool needEvent(const int currentIndex, const int size, MultiChannelStateSequence *multiChannelStateSequence, int channelIndex); -#endif /* TRIGGER_EMULATOR_ALGO_H_ */ diff --git a/firmware/util/efitime.h b/firmware/util/efitime.h index e44761d950..48e7ccb6f6 100644 --- a/firmware/util/efitime.h +++ b/firmware/util/efitime.h @@ -7,8 +7,7 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#ifndef EFITIME_H_ -#define EFITIME_H_ +#pragma once #include "efifeatures.h" #include "rusefi_types.h" @@ -72,5 +71,3 @@ efitimesec_t getTimeNowSeconds(void); #else #define getTimeNowLowerNt() 0 #endif - -#endif /* EFITIME_H_ */