From ea698a6f0941c19602228e7d085766f73119ec20 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 26 Jun 2017 09:14:31 +0300 Subject: [PATCH] refactoring: better name --- firmware/controllers/algo/engine.h | 2 +- .../controllers/algo/engine_configuration.cpp | 2 +- ...ngine_configuration_generated_structures.h | 18 +++++----- firmware/controllers/algo/rusefi_generated.h | 2 +- firmware/controllers/core/fsio_core.cpp | 2 +- firmware/controllers/core/fsio_impl.cpp | 34 +++++++++---------- firmware/controllers/system/efiGpio.cpp | 2 +- firmware/controllers/system/efiGpio.h | 2 +- firmware/integration/rusefi_config.txt | 16 ++++----- .../models/src/com/rusefi/config/Fields.java | 4 +-- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index beae4c5846..56e53b67b1 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -267,7 +267,7 @@ public: FuelSchedule injectionEvents; #endif /* EFI_ENGINE_CONTROL */ - float fsioLastValue[LE_COMMAND_COUNT]; + float fsioLastValue[FSIO_COMMAND_COUNT]; WallFuel wallFuel; diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 8043cdd143..a2df37b0d4 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -517,7 +517,7 @@ static void setDefaultFsioParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) { for (int i = 0; i < AUX_PID_COUNT; i++) { engineConfiguration->auxPidPins[i] = GPIO_UNASSIGNED; } - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { boardConfiguration->fsioPins[i] = GPIO_UNASSIGNED; config->le_formulas[i][0] = 0; boardConfiguration->fsioDigitalInputs[i] = GPIO_UNASSIGNED; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 9f7b4fd0d5..e495647562 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jun 25 00:14:59 EEST 2017 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Jun 26 09:05:40 MSK 2017 // begin #ifndef ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_ @@ -648,11 +648,11 @@ typedef struct { /** * offset 444 */ - brain_pin_e fsioPins[LE_COMMAND_COUNT]; + brain_pin_e fsioPins[FSIO_COMMAND_COUNT]; /** * offset 508 */ - pin_output_mode_e gpioPinModes[LE_COMMAND_COUNT]; + pin_output_mode_e gpioPinModes[FSIO_COMMAND_COUNT]; /** * offset 572 */ @@ -697,7 +697,7 @@ typedef struct { /** * offset 608 */ - fsio_pwm_freq_t fsioFrequency[LE_COMMAND_COUNT]; + fsio_pwm_freq_t fsioFrequency[FSIO_COMMAND_COUNT]; /** * offset 640 */ @@ -713,7 +713,7 @@ typedef struct { /** * offset 652 */ - fsio_setting_t fsio_setting[LE_COMMAND_COUNT]; + fsio_setting_t fsio_setting[FSIO_COMMAND_COUNT]; /** * offset 716 */ @@ -800,7 +800,7 @@ typedef struct { * These input pins allow us to pull toggle buttons state * offset 796 */ - brain_pin_e fsioDigitalInputs[LE_COMMAND_COUNT]; + brain_pin_e fsioDigitalInputs[FSIO_COMMAND_COUNT]; /** * offset 860 */ @@ -1390,7 +1390,7 @@ typedef struct { /** * offset 1548 */ - pin_input_mode_e fsioInputModes[LE_COMMAND_COUNT]; + pin_input_mode_e fsioInputModes[FSIO_COMMAND_COUNT]; /** * offset 1612 */ @@ -1923,7 +1923,7 @@ typedef struct { /** * offset 3048 */ - le_formula_t le_formulas[LE_COMMAND_COUNT]; + le_formula_t le_formulas[FSIO_COMMAND_COUNT]; /** * offset 6248 */ @@ -2126,4 +2126,4 @@ typedef struct { #endif // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jun 25 00:14:59 EEST 2017 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Jun 26 09:05:40 MSK 2017 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 7d1086543d..458e891ecb 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -37,7 +37,7 @@ #define HW_MAX_ADC_INDEX 17 #define TRIGGER_SIMULATOR_PIN_COUNT 3 #define LOGIC_ANALYZER_CHANNEL_COUNT 4 -#define LE_COMMAND_COUNT 16 +#define FSIO_COMMAND_COUNT 16 #define AUX_PID_COUNT 4 #define FUEL_RPM_COUNT 16 #define FUEL_LOAD_COUNT 16 diff --git a/firmware/controllers/core/fsio_core.cpp b/firmware/controllers/core/fsio_core.cpp index 830076d681..acf86b6d8a 100644 --- a/firmware/controllers/core/fsio_core.cpp +++ b/firmware/controllers/core/fsio_core.cpp @@ -252,7 +252,7 @@ bool LECalculator::processElement(LEElement *element DECLARE_ENGINE_PARAMETER_SU case LE_METHOD_FSIO_SETTING: { float humanIndex = pop(LE_METHOD_FSIO_SETTING); int index = (int) humanIndex - 1; - if (index >= 0 && index < LE_COMMAND_COUNT) { + if (index >= 0 && index < FSIO_COMMAND_COUNT) { push(element->action, boardConfiguration->fsio_setting[index]); } else { push(element->action, NAN); diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index f2b49da833..2d821c6b14 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -64,7 +64,7 @@ LEElementPool sysPool(sysElements, SYS_ELEMENT_POOL_SIZE); static LEElement userElements[UD_ELEMENT_POOL_SIZE] CCM_OPTIONAL; LEElementPool userPool(userElements, UD_ELEMENT_POOL_SIZE); -static LEElement * fsioLogics[LE_COMMAND_COUNT] CCM_OPTIONAL; +static LEElement * fsioLogics[FSIO_COMMAND_COUNT] CCM_OPTIONAL; static LEElement * acRelayLogic; static LEElement * fuelPumpLogic; @@ -134,7 +134,7 @@ float getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) { static void setFsioInputPin(const char *indexStr, const char *pinName) { int index = atoi(indexStr) - 1; - if (index < 0 || index >= LE_COMMAND_COUNT) { + if (index < 0 || index >= FSIO_COMMAND_COUNT) { scheduleMsg(logger, "invalid FSIO index: %d", index); return; } @@ -166,7 +166,7 @@ static void setFsioPidOutputPin(const char *indexStr, const char *pinName) { static void setFsioOutputPin(const char *indexStr, const char *pinName) { int index = atoi(indexStr) - 1; - if (index < 0 || index >= LE_COMMAND_COUNT) { + if (index < 0 || index >= FSIO_COMMAND_COUNT) { scheduleMsg(logger, "invalid FSIO index: %d", index); return; } @@ -202,7 +202,7 @@ void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMET void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { userPool.reset(); - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { brain_pin_e brainPin = boardConfiguration->fsioPins[i]; if (brainPin != GPIO_UNASSIGNED) { @@ -219,10 +219,10 @@ void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_PROD_CODE || defined(__DOXYGEN__) -static SimplePwm fsioPwm[LE_COMMAND_COUNT] CCM_OPTIONAL; +static SimplePwm fsioPwm[FSIO_COMMAND_COUNT] CCM_OPTIONAL; static LECalculator calc; -extern LEElement * fsioLogics[LE_COMMAND_COUNT]; +extern LEElement * fsioLogics[FSIO_COMMAND_COUNT]; // that's crazy, but what's an alternative? we need const char *, a shared buffer would not work for pin repository static const char *getGpioPinName(int index) { @@ -264,7 +264,7 @@ static const char *getGpioPinName(int index) { } /** - * @param index from zero for (LE_COMMAND_COUNT - 1) + * @param index from zero for (FSIO_COMMAND_COUNT - 1) */ static void handleFsio(Engine *engine, int index) { if (boardConfiguration->fsioPins[index] == GPIO_UNASSIGNED) @@ -343,7 +343,7 @@ static void setPinState(const char * msg, OutputPin *pin, LEElement *element) { static void setFsioFrequency(int index, int frequency) { index--; - if (index < 0 || index >= LE_COMMAND_COUNT) { + if (index < 0 || index >= FSIO_COMMAND_COUNT) { scheduleMsg(logger, "invalid FSIO index: %d", index); return; } @@ -356,7 +356,7 @@ static void setFsioFrequency(int index, int frequency) { } void runFsio(void) { - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { handleFsio(engine, i); } @@ -428,7 +428,7 @@ static void showFsioInfo(void) { - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { char * exp = config->le_formulas[i]; if (exp[0] != 0) { /** @@ -442,13 +442,13 @@ static void showFsioInfo(void) { showFsio(NULL, fsioLogics[i]); } } - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { float v = boardConfiguration->fsio_setting[i]; if (!cisnan(v)) { scheduleMsg(logger, "user property #%d: %f", i + 1, v); } } - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { brain_pin_e inputPin = boardConfiguration->fsioDigitalInputs[i]; if (inputPin != GPIO_UNASSIGNED) { scheduleMsg(logger, "FSIO digital input #%d: %s", i, hwPortname(inputPin)); @@ -463,7 +463,7 @@ static void showFsioInfo(void) { static void setFsioSetting(float humanIndexF, float value) { #if EFI_PROD_CODE || EFI_SIMULATOR int index = (int)humanIndexF - 1; - if (index < 0 || index >= LE_COMMAND_COUNT) { + if (index < 0 || index >= FSIO_COMMAND_COUNT) { scheduleMsg(logger, "invalid FSIO index: %d", (int)humanIndexF); return; } @@ -475,7 +475,7 @@ static void setFsioSetting(float humanIndexF, float value) { static void setFsioExpression(const char *indexStr, const char *quotedLine, Engine *engine) { #if EFI_PROD_CODE || EFI_SIMULATOR int index = atoi(indexStr) - 1; - if (index < 0 || index >= LE_COMMAND_COUNT) { + if (index < 0 || index >= FSIO_COMMAND_COUNT) { scheduleMsg(logger, "invalid FSIO index: %d", index); return; } @@ -512,7 +512,7 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { #if EFI_PROD_CODE || EFI_SIMULATOR logger = sharedLogger; #endif - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { fsioLogics[i] = NULL; } @@ -531,7 +531,7 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { #endif /* EFI_MAIN_RELAY_CONTROL */ #if EFI_PROD_CODE || defined(__DOXYGEN__) - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { brain_pin_e brainPin = boardConfiguration->fsioPins[i]; if (brainPin != GPIO_UNASSIGNED) { @@ -544,7 +544,7 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { } } - for (int i = 0; i < LE_COMMAND_COUNT; i++) { + for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { brain_pin_e inputPin = boardConfiguration->fsioDigitalInputs[i]; if (inputPin != GPIO_UNASSIGNED) { diff --git a/firmware/controllers/system/efiGpio.cpp b/firmware/controllers/system/efiGpio.cpp index be00d3f352..ecab56122d 100644 --- a/firmware/controllers/system/efiGpio.cpp +++ b/firmware/controllers/system/efiGpio.cpp @@ -100,7 +100,7 @@ void EnginePins::unregisterPins() { idleSolenoidPin.unregisterOutput(activeConfiguration.bc.idle.solenoidPin, engineConfiguration->bc.idle.solenoidPin); - for (int i = 0;i < LE_COMMAND_COUNT;i++) { + for (int i = 0;i < FSIO_COMMAND_COUNT;i++) { fsioOutputs[i].unregisterOutput(activeConfiguration.bc.fsioPins[i], engineConfiguration->bc.fsioPins[i]); } diff --git a/firmware/controllers/system/efiGpio.h b/firmware/controllers/system/efiGpio.h index bbed4a3227..217438520c 100644 --- a/firmware/controllers/system/efiGpio.h +++ b/firmware/controllers/system/efiGpio.h @@ -118,7 +118,7 @@ public: NamedOutputPin tachOut; OutputPin etbOutput1; OutputPin etbOutput2; - OutputPin fsioOutputs[LE_COMMAND_COUNT]; + OutputPin fsioOutputs[FSIO_COMMAND_COUNT]; OutputPin triggerDecoderErrorPin; OutputPin hipCs; OutputPin sdCsPin; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index ad1c80153b..6e39136f08 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -70,7 +70,7 @@ struct_no_prefix engine_configuration_s #define HW_MAX_ADC_INDEX 17 #define TRIGGER_SIMULATOR_PIN_COUNT 3 #define LOGIC_ANALYZER_CHANNEL_COUNT 4 -#define LE_COMMAND_COUNT 16 +#define FSIO_COMMAND_COUNT 16 #define AUX_PID_COUNT 4 #define FUEL_RPM_COUNT 16 @@ -523,8 +523,8 @@ bit is_enabled_spi_2 spi_device_e max31855spiDevice; - brain_pin_e[LE_COMMAND_COUNT iterate] fsioPins; - pin_output_mode_e[LE_COMMAND_COUNT iterate] gpioPinModes; + brain_pin_e[FSIO_COMMAND_COUNT iterate] fsioPins; + pin_output_mode_e[FSIO_COMMAND_COUNT iterate] gpioPinModes; custom uart_device_e 4 bits,U32, @OFFSET@, [0:1], "Off", "UART1", "UART2", "UART3" uart_device_e consoleUartDevice; @@ -543,13 +543,13 @@ custom uart_device_e 4 bits,U32, @OFFSET@, [0:1], "Off", "UART1", "UART2", "UA custom pid_dt 4 scalar, U32, @OFFSET@, "ms", 1, 0, 0, 3000, 0 custom fsio_pwm_freq_t 2 scalar, U16, @OFFSET@, "Hz", 1, 0, 0, 3000, 0 - fsio_pwm_freq_t[LE_COMMAND_COUNT iterate] fsioFrequency; + fsio_pwm_freq_t[FSIO_COMMAND_COUNT iterate] fsioFrequency; brain_pin_e hip9011CsPin; brain_pin_e hip9011IntHoldPin; pin_output_mode_e hip9011IntHoldPinMode; custom fsio_setting_t 4 scalar, F32, @OFFSET@, "Val", 1, 0, 0, 18000, 4 - fsio_setting_t[LE_COMMAND_COUNT iterate] fsio_setting; + fsio_setting_t[FSIO_COMMAND_COUNT iterate] fsio_setting; brain_pin_e spi1mosiPin; brain_pin_e spi1misoPin; brain_pin_e spi1sckPin; @@ -580,7 +580,7 @@ brain_input_pin_e vehicleSpeedSensorInputPin; brain_pin_e clutchUpPin;Some vehicles have a switch to indicate that clutch pedal is all the way up pin_input_mode_e clutchUpPinMode; - brain_pin_e[LE_COMMAND_COUNT iterate] fsioDigitalInputs;These input pins allow us to pull toggle buttons state; + brain_pin_e[FSIO_COMMAND_COUNT iterate] fsioDigitalInputs;These input pins allow us to pull toggle buttons state; brain_input_pin_e frequencyReportingMapInputPin; @@ -658,7 +658,7 @@ float idleStepperReactionTime;;"ms", 1, 0, 1, 300, 0 float knockVThreshold;;"V", 1, 0, 1, 5, 2 custom pin_input_mode_e 4 scalar, F32, @OFFSET@, "ms", 1, 0, 0, 200, 1 - pin_input_mode_e[LE_COMMAND_COUNT iterate] fsioInputModes; + pin_input_mode_e[FSIO_COMMAND_COUNT iterate] fsioInputModes; adc_channel_e externalKnockSenseAdc; int[3] unsed2342342; @@ -820,7 +820,7 @@ end_struct engine_configuration_s engineConfiguration; -le_formula_t[LE_COMMAND_COUNT iterate] le_formulas; +le_formula_t[FSIO_COMMAND_COUNT iterate] le_formulas; le_formula_t timingMultiplier; le_formula_t timingAdditive; diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 0ab502a4d2..36a5d278db 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jun 25 00:14:59 EEST 2017 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Jun 26 09:05:40 MSK 2017 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int BLOCKING_FACTOR = 400; @@ -26,7 +26,7 @@ public class Fields { public static final int HW_MAX_ADC_INDEX = 17; public static final int TRIGGER_SIMULATOR_PIN_COUNT = 3; public static final int LOGIC_ANALYZER_CHANNEL_COUNT = 4; - public static final int LE_COMMAND_COUNT = 16; + public static final int FSIO_COMMAND_COUNT = 16; public static final int AUX_PID_COUNT = 4; public static final int FUEL_RPM_COUNT = 16; public static final int FUEL_LOAD_COUNT = 16;