cleanup extern mess (#1237)

* cleanup

* move outside define
This commit is contained in:
Matthew Kennedy 2020-03-29 16:06:03 -07:00 committed by GitHub
parent b0d8cae798
commit 8fd9842310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 41 additions and 101 deletions

View File

@ -13,8 +13,7 @@
#include "engine_configuration.h"
#include "smart_gpio.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
static void vag_18_Turbo(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
}

View File

@ -14,8 +14,7 @@
#include "engine_configuration.h"
#include "smart_gpio.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
void vag_18_Turbo(DECLARE_ENGINE_PARAMETER_SIGNATURE) {

View File

@ -34,8 +34,7 @@ static thread_reference_t btThreadRef = nullptr; // used by thread suspend/resum
static LoggingWithStorage btLogger("bluetooth");
EXTERN_ENGINE
;
EXTERN_ENGINE;
// Main communication code

View File

@ -103,8 +103,7 @@
#endif /* EFI_IDLE_CONTROL */
EXTERN_ENGINE
;
EXTERN_ENGINE;
extern persistent_config_container_s persistentState;

View File

@ -102,7 +102,6 @@ extern WaveChart waveChart;
int warningEnabled = true;
extern bool hasFirmwareErrorFlag;
extern int maxTriggerReentraint;
extern uint32_t maxLockedDuration;
@ -172,8 +171,7 @@ static void reportSensorI(Logging *log, const char *caption, const char *units,
#endif /* EFI_FILE_LOGGING */
}
EXTERN_ENGINE
;
EXTERN_ENGINE;
static char buf[6];

View File

@ -30,8 +30,7 @@
#error "Unexpected OS ACCESS HERE"
#endif /* HAS_OS_ACCESS */
EXTERN_ENGINE
;
EXTERN_ENGINE;
static Logging *logger;

View File

@ -25,8 +25,7 @@
#error "Unexpected OS ACCESS HERE"
#endif /* HAS_OS_ACCESS */
EXTERN_ENGINE
;
EXTERN_ENGINE;
extern fsio8_Map3D_f32t fsioTable1;

View File

@ -52,8 +52,7 @@ static StepperMotor iacMotor;
static Logging *logger;
EXTERN_ENGINE
;
EXTERN_ENGINE;
static bool shouldResetPid = false;
// The idea of 'mightResetPid' is to reset PID only once - each time when TPS > idlePidDeactivationTpsThreshold.

View File

@ -32,8 +32,7 @@
#include "tunerstudio_configuration.h"
#endif /* EFI_TUNER_STUDIO */
EXTERN_ENGINE
;
EXTERN_ENGINE;
tps_tps_Map3D_t tpsTpsMap("tpsTps");

View File

@ -31,8 +31,7 @@
#if EFI_ENGINE_CONTROL
EXTERN_ENGINE
;
EXTERN_ENGINE;
static ign_Map3D_t advanceMap("advance");
// This coeff in ctor parameter is sufficient for int16<->float conversion!

View File

@ -39,8 +39,7 @@ static TriggerState initState CCM_OPTIONAL;
LoggingWithStorage engineLogger("engine");
EXTERN_ENGINE
;
EXTERN_ENGINE;
#if EFI_ENGINE_SNIFFER
#include "engine_sniffer.h"

View File

@ -28,8 +28,7 @@
extern fuel_Map3D_t veMap;
extern afr_Map3D_t afrMap;
EXTERN_ENGINE
;
EXTERN_ENGINE;
// this does not look exactly right
extern LoggingWithStorage engineLogger;

View File

@ -31,8 +31,7 @@
#include "speed_density.h"
#include "perf_trace.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
fuel_Map3D_t fuelMap("fuel");
static fuel_Map3D_t fuelPhaseMap("fl ph");

View File

@ -30,8 +30,7 @@ static Logging *logger;
extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */
EXTERN_ENGINE
;
EXTERN_ENGINE;
static bool getActivateSwitchCondition(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
switch (engineConfiguration->launchActivationMode) {

View File

@ -51,8 +51,7 @@
EXTERN_ENGINE
;
EXTERN_ENGINE;
static Logging * logger;
static bool isRunningBench = false;

View File

@ -39,8 +39,7 @@
#include "fuel_math.h"
#include "thermistors.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
static LoggingWithStorage logger("obd2");

View File

@ -31,6 +31,8 @@ typedef uint8_t critical_msg_t[ERROR_BUFFER_SIZE];
*/
void firmwareError(obd_code_e code, const char *fmt, ...);
extern bool hasFirmwareErrorFlag;
#define hasFirmwareError() hasFirmwareErrorFlag
// todo: rename to getCriticalErrorMessage

View File

@ -15,6 +15,8 @@
#include "fsio_impl.h"
#include "allsensors.h"
EXTERN_ENGINE;
#if EFI_FSIO
#include "os_access.h"
@ -106,9 +108,6 @@ static LEElement * starterRelayDisableLogic;
static LEElement * mainRelayLogic;
#endif /* EFI_MAIN_RELAY_CONTROL */
EXTERN_ENGINE
;
static Logging *logger;
#if EFI_PROD_CODE || EFI_SIMULATOR
@ -732,9 +731,6 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
#else /* !EFI_FSIO */
EXTERN_ENGINE
;
// "Limp-mode" implementation for some RAM-limited configs without FSIO
void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// see MAIN_RELAY_LOGIC

View File

@ -102,8 +102,6 @@ EXTERN_ENGINE;
#if !EFI_UNIT_TEST
extern bool hasFirmwareErrorFlag;
static LoggingWithStorage logger("Engine Controller");
/**

View File

@ -19,8 +19,7 @@
#include "trigger_central.h"
#include "spark_logic.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
void plainPinTurnOn(AuxActor *current) {
NamedOutputPin *output = &enginePins.auxValve[current->valveIndex];

View File

@ -51,9 +51,7 @@
#include "backup_ram.h"
EXTERN_ENGINE
;
extern bool hasFirmwareErrorFlag;
EXTERN_ENGINE;
static const char *prevOutputName = nullptr;

View File

@ -93,8 +93,7 @@ static int averagedMapBufIdx = 0;
// this is 'minimal averaged' MAP within avegaging window
static float currentPressure = NO_VALUE_YET;
EXTERN_ENGINE
;
EXTERN_ENGINE;
/**
* here we have averaging start and averaging end points for each cylinder

View File

@ -81,10 +81,7 @@ int RpmCalculator::getRpm(DECLARE_ENGINE_PARAMETER_SIGNATURE) const {
#if EFI_SHAFT_POSITION_INPUT
EXTERN_ENGINE
;
extern bool hasFirmwareErrorFlag;
EXTERN_ENGINE;
static Logging * logger;

View File

@ -42,9 +42,7 @@
#include "fuel_math.h"
EXTERN_ENGINE
;
extern bool hasFirmwareErrorFlag;
EXTERN_ENGINE;
static MenuItem ROOT(NULL, NULL);

View File

@ -30,8 +30,7 @@
#include "advance_map.h"
#include "config_engine_specs.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
#if EFI_UNIT_TEST
extern bool verboseMode;
#endif /* EFI_UNIT_TEST */

View File

@ -3,8 +3,7 @@
#include "adc_inputs.h"
#include "maf.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
/**
* @return MAF sensor voltage

View File

@ -29,7 +29,7 @@
*/
class StoredValueSensor : public Sensor {
public:
SensorResult get() const final {
SensorResult get() const final override {
bool valid = m_isValid;
float value = m_value;

View File

@ -24,8 +24,7 @@
#define LIMPING_MODE_CLT_TEMPERATURE 70.0f
#define NO_CLT_SENSOR_TEMPERATURE 72.0f
EXTERN_ENGINE
;
EXTERN_ENGINE;
static Logging *logger = nullptr;

View File

@ -58,8 +58,7 @@ extern WaveChart waveChart;
static char LOGGING_BUFFER[SETTINGS_LOGGING_BUFFER_SIZE];
static Logging logger("settings control", LOGGING_BUFFER, sizeof(LOGGING_BUFFER));
EXTERN_ENGINE
;
EXTERN_ENGINE;
/*
static void printIntArray(int array[], int size) {

View File

@ -396,8 +396,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
}
}
EXTERN_ENGINE
;
EXTERN_ENGINE;
static void triggerShapeInfo(void) {
#if EFI_PROD_CODE || EFI_SIMULATOR

View File

@ -104,8 +104,7 @@ TriggerStateWithRunningStatistics::TriggerStateWithRunningStatistics() :
#if EFI_SHAFT_POSITION_INPUT
EXTERN_ENGINE
;
EXTERN_ENGINE;
#if ! EFI_PROD_CODE
bool printTriggerDebug = false;

View File

@ -41,8 +41,7 @@ bool needEvent(const int currentIndex, const int size, MultiChannelStateSequence
TriggerEmulatorHelper::TriggerEmulatorHelper() {
}
EXTERN_ENGINE
;
EXTERN_ENGINE;
void TriggerEmulatorHelper::handleEmulatorCallback(PwmConfig *state, int stateIndex) {
efitick_t stamp = getTimeNowNt();

View File

@ -22,8 +22,6 @@
#include "poten.h"
#include "trigger_emulator.h"
extern bool hasFirmwareErrorFlag;
static THD_WORKING_AREA(eeThreadStack, UTILITY_THREAD_STACK_SIZE);
#define DIAG_PIN GPIOD_0

View File

@ -38,8 +38,7 @@
#define CHART_DELIMETER '!'
EXTERN_ENGINE
;
EXTERN_ENGINE;
extern uint32_t maxLockedDuration;
/**

View File

@ -37,7 +37,6 @@ EXTERN_ENGINE;
#if EFI_ENGINE_SNIFFER
extern WaveChart waveChart;
#endif /* EFI_ENGINE_SNIFFER */
extern bool hasFirmwareErrorFlag;
/**
* Difference between current 1st trigger event and previous 1st trigger event.

View File

@ -22,8 +22,7 @@
#include "mpu_util.h"
#include "engine.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
static int canReadCounter = 0;
static int canWriteOk = 0;

View File

@ -61,9 +61,7 @@
#include "flash_main.h"
#endif
EXTERN_ENGINE
;
extern bool hasFirmwareErrorFlag;
EXTERN_ENGINE;
static mutex_t spiMtx;

View File

@ -132,9 +132,7 @@ void Hip9011Hardware::sendCommand(unsigned char command) {
spiStartExchangeI(driver, 1, tx_buff, rx_buff);
}
EXTERN_ENGINE
;
EXTERN_ENGINE;
static char hipPinNameBuffer[16];

View File

@ -61,8 +61,6 @@ static int timerFreezeCounter = 0;
static volatile int setHwTimerCounter = 0;
static volatile bool hwStarted = false;
extern bool hasFirmwareErrorFlag;
/**
* sets the alarm to the specified number of microseconds from now.
* This function should be invoked under kernel lock which would disable interrupts.

View File

@ -20,8 +20,7 @@
#include "pin_repository.h"
#include "digital_input_exti.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
static int joyTotal = 0;
static int joyCenter;

View File

@ -16,11 +16,8 @@
#include "trigger_input.h"
#include "digital_input_icu.h"
EXTERN_ENGINE;
extern bool hasFirmwareErrorFlag;
EXTERN_ENGINE
;
static Logging *logger;
static volatile int centeredDacValue = 127;

View File

@ -21,8 +21,6 @@
#error "PAL_USE_CALLBACKS should be enabled to use HAL_TRIGGER_USE_PAL"
#endif
extern bool hasFirmwareErrorFlag;
static Logging *logger;
EXTERN_ENGINE;

View File

@ -24,8 +24,6 @@ int icuFallingCallbackCounter = 0;
EXTERN_ENGINE;
extern bool hasFirmwareErrorFlag;
static Logging *logger;
static void vvtRisingCallback(void *) {

View File

@ -13,8 +13,7 @@
#include "digital_input_icu.h"
#include "pin_repository.h"
EXTERN_ENGINE
;
EXTERN_ENGINE;
static Logging *logger;

View File

@ -137,12 +137,9 @@ bool main_loop_started = false;
static char panicMessage[200];
extern bool hasFirmwareErrorFlag;
static virtual_timer_t resetTimer;
EXTERN_ENGINE
;
EXTERN_ENGINE;
// todo: move this into a hw-specific file
void rebootNow(void) {