From 29804cbc8aed651ab3cbc5c16ef7374f1a08b652 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 8 Oct 2019 18:02:51 -0700 Subject: [PATCH] move tsOutputChannels to header (#970) --- firmware/console/binary/tunerstudio.cpp | 4 ---- firmware/console/binary/tunerstudio.h | 2 ++ firmware/console/binary/tunerstudio_configuration.h | 2 ++ firmware/console/status_loop.cpp | 7 ------- firmware/console/tooth_logger.cpp | 2 -- firmware/controllers/actuators/alternator_controller.cpp | 4 ---- firmware/controllers/actuators/aux_pid.cpp | 4 ---- firmware/controllers/actuators/electronic_throttle.cpp | 3 --- firmware/controllers/actuators/idle_thread.cpp | 4 +--- firmware/controllers/algo/accel_enrichment.cpp | 1 - firmware/controllers/algo/advance_map.cpp | 4 ---- firmware/controllers/algo/engine.cpp | 4 ---- firmware/controllers/algo/engine2.cpp | 4 ---- firmware/controllers/scheduling/single_timer_executor.cpp | 4 ---- firmware/controllers/trigger/main_trigger_callback.cpp | 3 --- firmware/controllers/trigger/spark_logic.cpp | 1 - firmware/controllers/trigger/trigger_central.cpp | 1 - firmware/controllers/trigger/trigger_decoder.cpp | 4 ---- firmware/hw_layer/drivers/gpio/tle8888.c | 1 - firmware/hw_layer/mmc_card.cpp | 4 ---- firmware/hw_layer/sensors/cj125.cpp | 1 - firmware/init/sensor/init_oil_pressure.cpp | 2 -- 22 files changed, 5 insertions(+), 61 deletions(-) diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 30cd32588d..50476cfc3e 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -129,10 +129,6 @@ static ts_channel_s tsChannel; // this thread wants a bit extra stack static THD_WORKING_AREA(tunerstudioThreadStack, 3 * UTILITY_THREAD_STACK_SIZE); -extern TunerStudioOutputChannels tsOutputChannels; - -extern tunerstudio_counters_s tsState; - static void resetTs(void) { memset(&tsState, 0, sizeof(tsState)); } diff --git a/firmware/console/binary/tunerstudio.h b/firmware/console/binary/tunerstudio.h index f85c5a8592..2afce1a9e6 100644 --- a/firmware/console/binary/tunerstudio.h +++ b/firmware/console/binary/tunerstudio.h @@ -29,6 +29,8 @@ typedef struct { int testCommandCounter; } tunerstudio_counters_s; +extern tunerstudio_counters_s tsState; + /** * handle non CRC wrapped command */ diff --git a/firmware/console/binary/tunerstudio_configuration.h b/firmware/console/binary/tunerstudio_configuration.h index b743985d65..7418f76239 100644 --- a/firmware/console/binary/tunerstudio_configuration.h +++ b/firmware/console/binary/tunerstudio_configuration.h @@ -180,4 +180,6 @@ typedef struct { /* see also [OutputChannels] in rusefi.input */ } TunerStudioOutputChannels; +extern TunerStudioOutputChannels tsOutputChannels; + #endif /* TUNERSTUDIO_CONFIGURATION_H_ */ diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 6127661e52..1e83ed3824 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -101,11 +101,6 @@ static volatile bool fullLog = true; int warningEnabled = true; //int warningEnabled = FALSE; -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -extern tunerstudio_counters_s tsState; -#endif - extern bool hasFirmwareErrorFlag; extern int maxTriggerReentraint; extern uint32_t maxLockedDuration; @@ -1010,8 +1005,6 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ } } -extern TunerStudioOutputChannels tsOutputChannels; - void prepareTunerStudioOutputs(void) { // sensor state for EFI Analytics Tuner Studio updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER_SUFFIX); diff --git a/firmware/console/tooth_logger.cpp b/firmware/console/tooth_logger.cpp index e511190e93..4fd0eddfb7 100644 --- a/firmware/console/tooth_logger.cpp +++ b/firmware/console/tooth_logger.cpp @@ -16,8 +16,6 @@ #include "efilib.h" #include "tunerstudio_configuration.h" -extern TunerStudioOutputChannels tsOutputChannels; - static uint16_t buffer[1000] CCM_OPTIONAL; static size_t NextIdx = 0; static volatile bool ToothLoggerEnabled = false; diff --git a/firmware/controllers/actuators/alternator_controller.cpp b/firmware/controllers/actuators/alternator_controller.cpp index 761631ffab..eb1d626fa8 100644 --- a/firmware/controllers/actuators/alternator_controller.cpp +++ b/firmware/controllers/actuators/alternator_controller.cpp @@ -36,10 +36,6 @@ Pid alternatorPid(altPidS); static percent_t currentAltDuty; -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ - static bool currentPlainOnOffState = false; static bool shouldResetPid = false; diff --git a/firmware/controllers/actuators/aux_pid.cpp b/firmware/controllers/actuators/aux_pid.cpp index 9763ae5197..1b45c5f6da 100644 --- a/firmware/controllers/actuators/aux_pid.cpp +++ b/firmware/controllers/actuators/aux_pid.cpp @@ -33,10 +33,6 @@ extern fsio8_Map3D_f32t fsioTable1; // todo: this is to some extent a copy-paste of alternator_controller. maybe same loop // for all PIDs? -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ - static Logging *logger; static bool isEnabled(int index) { diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 0600fa0555..87f32d5f5e 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -90,9 +90,6 @@ #define ETB_MAX_COUNT 2 -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ static bool shouldResetPid = false; static pid_s tuneWorkingPidSettings; diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index e1ee27b368..30ec945f24 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -47,9 +47,7 @@ static StepperMotor iacMotor; static Logging *logger; -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ + EXTERN_ENGINE ; diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index d7adfb4259..7c70af06a0 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -29,7 +29,6 @@ #include "engine_math.h" #if EFI_TUNER_STUDIO #include "tunerstudio_configuration.h" -extern TunerStudioOutputChannels tsOutputChannels; #endif /* EFI_TUNER_STUDIO */ EXTERN_ENGINE diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 29db7f699b..b6558bed5a 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -30,10 +30,6 @@ EXTERN_ENGINE ; -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ - static ign_Map3D_t advanceMap("advance"); // This coeff in ctor parameter is sufficient for int16<->float conversion! static ign_tps_Map3D_t advanceTpsMap("advanceTps", 1.0 / ADVANCE_TPS_STORAGE_MULT); diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 78bb5de27e..7d14c191bc 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -42,10 +42,6 @@ LoggingWithStorage engineLogger("engine"); EXTERN_ENGINE ; -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ - FsioState::FsioState() { #if EFI_ENABLE_ENGINE_WARNING isEngineWarning = FALSE; diff --git a/firmware/controllers/algo/engine2.cpp b/firmware/controllers/algo/engine2.cpp index 9def649f97..f839ac1cf4 100644 --- a/firmware/controllers/algo/engine2.cpp +++ b/firmware/controllers/algo/engine2.cpp @@ -32,10 +32,6 @@ EXTERN_ENGINE // this does not look exactly right extern LoggingWithStorage engineLogger; -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ - WarningCodeState::WarningCodeState() { clear(); } diff --git a/firmware/controllers/scheduling/single_timer_executor.cpp b/firmware/controllers/scheduling/single_timer_executor.cpp index de9a6c7918..5ee285ca2d 100644 --- a/firmware/controllers/scheduling/single_timer_executor.cpp +++ b/firmware/controllers/scheduling/single_timer_executor.cpp @@ -167,10 +167,6 @@ void initSingleTimerExecutorHardware(void) { initMicrosecondTimer(); } -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ - void executorStatistics() { if (engineConfiguration->debugMode == DBG_EXECUTOR) { #if EFI_TUNER_STUDIO && EFI_SIGNAL_EXECUTOR_ONE_TIMER diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 6ee0c4daa7..61727a5878 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -68,9 +68,6 @@ static Logging *logger; #if ! EFI_UNIT_TEST static pid_s *fuelPidS = &persistentState.persistentConfiguration.engineConfiguration.fuelClosedLoopPid; static Pid fuelPid(fuelPidS); -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ #endif // todo: figure out if this even helps? diff --git a/firmware/controllers/trigger/spark_logic.cpp b/firmware/controllers/trigger/spark_logic.cpp index 139783657b..314973f559 100644 --- a/firmware/controllers/trigger/spark_logic.cpp +++ b/firmware/controllers/trigger/spark_logic.cpp @@ -14,7 +14,6 @@ #if EFI_TUNER_STUDIO #include "tunerstudio_configuration.h" -extern TunerStudioOutputChannels tsOutputChannels; #endif /* EFI_TUNER_STUDIO */ EXTERN_ENGINE; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index ea2a37927d..846f57a708 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -32,7 +32,6 @@ #if EFI_TUNER_STUDIO #include "tunerstudio.h" -extern TunerStudioOutputChannels tsOutputChannels; #endif /* EFI_TUNER_STUDIO */ #if EFI_ENGINE_SNIFFER diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index e948ddce88..88174c9ba9 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -111,10 +111,6 @@ bool printTriggerDebug = false; float actualSynchGap; #endif /* ! EFI_PROD_CODE */ -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ - static Logging * logger; /** diff --git a/firmware/hw_layer/drivers/gpio/tle8888.c b/firmware/hw_layer/drivers/gpio/tle8888.c index 782dc08b9e..0a7ba6f6c2 100644 --- a/firmware/hw_layer/drivers/gpio/tle8888.c +++ b/firmware/hw_layer/drivers/gpio/tle8888.c @@ -45,7 +45,6 @@ #include "engine_configuration.h" EXTERN_CONFIG; #include "tunerstudio.h" -extern TunerStudioOutputChannels tsOutputChannels; #endif /* EFI_TUNER_STUDIO */ /* diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index 6857709023..97ff51147c 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -28,10 +28,6 @@ #include "rtc_helper.h" -#if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif - #define SD_STATE_INIT "init" #define SD_STATE_MOUNTED "MOUNTED" #define SD_STATE_MOUNT_FAILED "MOUNT_FAILED" diff --git a/firmware/hw_layer/sensors/cj125.cpp b/firmware/hw_layer/sensors/cj125.cpp index 1d95c1f322..53290706ad 100644 --- a/firmware/hw_layer/sensors/cj125.cpp +++ b/firmware/hw_layer/sensors/cj125.cpp @@ -23,7 +23,6 @@ EXTERN_ENGINE; #include "hardware.h" #include "backup_ram.h" #include "pin_repository.h" -extern TunerStudioOutputChannels tsOutputChannels; static Logging *logger; static unsigned char tx_buff[2]; diff --git a/firmware/init/sensor/init_oil_pressure.cpp b/firmware/init/sensor/init_oil_pressure.cpp index d5256cb699..d8d5b5a7ba 100644 --- a/firmware/init/sensor/init_oil_pressure.cpp +++ b/firmware/init/sensor/init_oil_pressure.cpp @@ -8,8 +8,6 @@ EXTERN_ENGINE; -extern TunerStudioOutputChannels tsOutputChannels; - LinearFunc oilpSensorFunc; FunctionalSensor oilpSensor(SensorType::OilPressure);