From 29c56ac36c53a1c672029e324e5eee4e4ffbf299 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 7 Feb 2015 08:04:13 -0600 Subject: [PATCH] auto-sync --- firmware/console/status_loop.cpp | 149 ++++++++++++------ .../tunerstudio/tunerstudio_configuration.h | 4 +- .../controllers/algo/engine_configuration.cpp | 2 +- ...ngine_configuration_generated_structures.h | 6 +- firmware/controllers/algo/rusefi_types.h | 4 +- firmware/controllers/settings.cpp | 2 +- firmware/hw_layer/max31855.cpp | 6 +- firmware/rusefi.cpp | 2 +- firmware/rusefi_config.ini | 4 +- firmware/tunerstudio/rusefi.ini | 23 ++- 10 files changed, 131 insertions(+), 71 deletions(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index f55fd65f8e..fa0e9411be 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -95,8 +95,8 @@ static LoggingWithStorage fileLogger("file logger"); static int logFileLineIndex = 0; #define TAB "\t" -static void reportSensorF(Logging *log, bool fileFormat, const char *caption, const char *units, float value, - int precision) { +static void reportSensorF(Logging *log, bool fileFormat, const char *caption, + const char *units, float value, int precision) { if (!fileFormat) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) debugFloat(log, caption, value, precision); @@ -118,7 +118,8 @@ static void reportSensorF(Logging *log, bool fileFormat, const char *caption, co } } -static void reportSensorI(Logging *log, bool fileFormat, const char *caption, const char *units, int value) { +static void reportSensorI(Logging *log, bool fileFormat, const char *caption, + const char *units, int value) { if (!fileFormat) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) @@ -152,8 +153,10 @@ void printSensors(Logging *log, bool fileFormat, Engine *engine) { #if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) reportSensorI(log, fileFormat, "rpm", "RPM", getRpmE(engine)); - reportSensorF(log, fileFormat, "TRG_0_DUTY", "%", getTriggerDutyCycle(0), 2); - reportSensorF(log, fileFormat, "TRG_1_DUTY", "%", getTriggerDutyCycle(1), 2); + reportSensorF(log, fileFormat, "TRG_0_DUTY", "%", getTriggerDutyCycle(0), + 2); + reportSensorF(log, fileFormat, "TRG_1_DUTY", "%", getTriggerDutyCycle(1), + 2); #endif reportSensorF(log, fileFormat, "maf", "V", getMaf(), 2); @@ -178,16 +181,21 @@ void printSensors(Logging *log, bool fileFormat, Engine *engine) { reportSensorF(log, fileFormat, "vss", "kph", getVehicleSpeed(), 2); } #endif /* EFI_PROD_CODE */ - reportSensorF(log, fileFormat, "vref", "V", getVRef(engineConfiguration), 2); - reportSensorF(log, fileFormat, "vbatt", "V", getVBatt(engineConfiguration), 2); + reportSensorF(log, fileFormat, "vref", "V", getVRef(engineConfiguration), + 2); + reportSensorF(log, fileFormat, "vbatt", "V", getVBatt(engineConfiguration), + 2); - reportSensorF(log, fileFormat, "TP", "%", getTPS(PASS_ENGINE_PARAMETER_F), 2); + reportSensorF(log, fileFormat, "TP", "%", getTPS(PASS_ENGINE_PARAMETER_F), + 2); if (engineConfiguration->hasCltSensor) { - reportSensorF(log, fileFormat, "CLT", "C", getCoolantTemperature(engine), 2); + reportSensorF(log, fileFormat, "CLT", "C", + getCoolantTemperature(engine), 2); } - reportSensorF(log, fileFormat, "MAT", "C", getIntakeAirTemperature(engine), 2); + reportSensorF(log, fileFormat, "MAT", "C", getIntakeAirTemperature(engine), + 2); // debugFloat(&logger, "tch", getTCharge1(tps), 2); @@ -221,13 +229,16 @@ static void printState(Engine *engine) { if (subscription[(int) RO_TOTAL_REVOLUTION_COUNTER]) debugInt(&logger, "ckp_c", getCrankEventCounter()); if (subscription[(int) RO_RUNNING_REVOLUTION_COUNTER]) - debugInt(&logger, "ckp_r", triggerCentral.triggerState.runningRevolutionCounter); + debugInt(&logger, "ckp_r", + triggerCentral.triggerState.runningRevolutionCounter); if (subscription[(int) RO_RUNNING_TRIGGER_ERROR]) - debugInt(&logger, "trg_r_errors", triggerCentral.triggerState.runningTriggerErrorCounter); + debugInt(&logger, "trg_r_errors", + triggerCentral.triggerState.runningTriggerErrorCounter); if (subscription[(int) RO_RUNNING_ORDERING_TRIGGER_ERROR]) - debugInt(&logger, "trg_r_order_errors", triggerCentral.triggerState.runningOrderingErrorCounter); + debugInt(&logger, "trg_r_order_errors", + triggerCentral.triggerState.runningOrderingErrorCounter); if (subscription[(int) RO_WAVE_CHART_CURRENT_SIZE]) debugInt(&logger, "wave_chart_current", 0); @@ -241,10 +252,13 @@ static void printState(Engine *engine) { debugFloat(&logger, "fuel_base", baseFuel, 2); // debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2); // debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2); - debugFloat(&logger, "fuel_lag", getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER), 2); + debugFloat(&logger, "fuel_lag", + getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER), + 2); debugFloat(&logger, "fuel", getFuelMs(rpm PASS_ENGINE_PARAMETER), 2); - debugFloat(&logger, "timing", getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER), 2); + debugFloat(&logger, "timing", + getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER), 2); // float map = getMap(); @@ -273,7 +287,8 @@ static systime_t timeOfPreviousPrintVersion = (systime_t) -1; #if EFI_PROD_CODE || defined(__DOXYGEN__) static void printOutPin(const char *pinName, brain_pin_e hwPin) { - appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName, hwPortname(hwPin), DELIMETER); + appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName, + hwPortname(hwPin), DELIMETER); } #endif /* EFI_PROD_CODE */ @@ -288,7 +303,8 @@ static void printInfo(Engine *engine, systime_t nowSeconds) { return; } timeOfPreviousPrintVersion = nowSeconds; - appendPrintf(&logger, "rusEfiVersion%s%d@%s %s%s", DELIMETER, getRusEfiVersion(), VCS_VERSION, + appendPrintf(&logger, "rusEfiVersion%s%d@%s %s%s", DELIMETER, + getRusEfiVersion(), VCS_VERSION, getConfigurationName(engineConfiguration->engineType), DELIMETER); #if EFI_PROD_CODE || defined(__DOXYGEN__) @@ -300,9 +316,11 @@ static void printInfo(Engine *engine, systime_t nowSeconds) { #endif for (int i = 0; i < engineConfiguration->cylindersCount; i++) { - printOutPin(enginePins.coils[i].name, boardConfiguration->ignitionPins[i]); + printOutPin(enginePins.coils[i].name, + boardConfiguration->ignitionPins[i]); - printOutPin(enginePins.injectors[i].name, boardConfiguration->injectionPins[i]); + printOutPin(enginePins.injectors[i].name, + boardConfiguration->injectionPins[i]); } #endif @@ -346,7 +364,8 @@ void updateDevConsoleState(Engine *engine) { #if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) int currentCkpEventCounter = getCrankEventCounter(); - if (prevCkpEventCounter == currentCkpEventCounter && timeOfPreviousReport == nowSeconds) { + if (prevCkpEventCounter == currentCkpEventCounter + && timeOfPreviousReport == nowSeconds) { return; } timeOfPreviousReport = nowSeconds; @@ -376,27 +395,36 @@ void updateDevConsoleState(Engine *engine) { static void showFuelInfo2(float rpm, float engineLoad, Engine *engine) { engine_configuration_s *engineConfiguration = engine->engineConfiguration; - float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, engineLoad); + float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, + engineLoad); - scheduleMsg(&logger, "SD magic fuel %f", sdMath(engineConfiguration, 100, 100, 14.7, convertCelsiusToKelvin(20))); + scheduleMsg(&logger, "SD magic fuel %f", + sdMath(engineConfiguration, 100, 100, 14.7, + convertCelsiusToKelvin(20))); - scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->algorithm), + scheduleMsg(&logger2, "algo=%s/pump=%s", + getEngine_load_mode_e(engineConfiguration->algorithm), boolToString(enginePins.fuelPumpRelay.getLogicValue())); #if EFI_ENGINE_CONTROL scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(engine)); if (engine->rpmCalculator.isRunning()) { - float iatCorrection = getIatCorrection(getIntakeAirTemperature(engine) PASS_ENGINE_PARAMETER); - float cltCorrection = getCltCorrection(getCoolantTemperature(engine) PASS_ENGINE_PARAMETER); - float injectorLag = getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER); + float iatCorrection = getIatCorrection( + getIntakeAirTemperature(engine) PASS_ENGINE_PARAMETER); + float cltCorrection = getCltCorrection( + getCoolantTemperature(engine) PASS_ENGINE_PARAMETER); + float injectorLag = getInjectorLag( + getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER); scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad); scheduleMsg(&logger2, "baseFuel=%f", baseFuelMs); - scheduleMsg(&logger2, "iatCorrection=%f cltCorrection=%f injectorLag=%f", iatCorrection, cltCorrection, - injectorLag); + scheduleMsg(&logger2, + "iatCorrection=%f cltCorrection=%f injectorLag=%f", + iatCorrection, cltCorrection, injectorLag); - float value = getRunningFuel(baseFuelMs, (int) rpm PASS_ENGINE_PARAMETER); + float value = getRunningFuel(baseFuelMs, + (int) rpm PASS_ENGINE_PARAMETER); scheduleMsg(&logger2, "injection pulse width: %f", value); } #endif @@ -404,7 +432,8 @@ static void showFuelInfo2(float rpm, float engineLoad, Engine *engine) { #if EFI_ENGINE_CONTROL static void showFuelInfo(Engine *engine) { - showFuelInfo2((float) getRpmE(engine), getEngineLoadT(PASS_ENGINE_PARAMETER), engine); + showFuelInfo2((float) getRpmE(engine), + getEngineLoadT(PASS_ENGINE_PARAMETER), engine); } #endif @@ -424,16 +453,20 @@ OutputPin warningPin; OutputPin runningPin; extern engine_pins_s enginePins; -static OutputPin *leds[] = { &warningPin, &runningPin, &enginePins.errorLedPin, &communicationPin, &checkEnginePin }; +static OutputPin *leds[] = { &warningPin, &runningPin, &enginePins.errorLedPin, + &communicationPin, &checkEnginePin }; static void initStatisLeds() { #if EFI_PROD_CODE - outputPinRegister("communication status 1", &communicationPin, LED_COMMUNICATION_PORT, LED_COMMUNICATION_PIN); + outputPinRegister("communication status 1", &communicationPin, + LED_COMMUNICATION_PORT, LED_COMMUNICATION_PIN); #endif #if EFI_WARNING_LED - outputPinRegister("warning", &warningPin, LED_WARNING_PORT, LED_WARNING_PIN); - outputPinRegister("is running status", &runningPin, LED_RUNNING_STATUS_PORT, LED_RUNNING_STATUS_PIN); + outputPinRegister("warning", &warningPin, LED_WARNING_PORT, + LED_WARNING_PIN); + outputPinRegister("is running status", &runningPin, LED_RUNNING_STATUS_PORT, + LED_RUNNING_STATUS_PIN); #endif /* EFI_WARNING_LED */ } @@ -501,7 +534,8 @@ static THD_WORKING_AREA(tsThreadStack, UTILITY_THREAD_STACK_SIZE); #if EFI_TUNER_STUDIO -void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputChannels) { +void updateTunerStudioState(Engine *engine, + TunerStudioOutputChannels *tsOutputChannels) { #if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) int rpm = getRpmE(engine); #else @@ -515,7 +549,8 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC float intake = getIntakeAirTemperature(engine); float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER); - float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, engineLoad); + float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, + engineLoad); // header tsOutputChannels->tsConfigVersion = TS_FILE_VERSION; @@ -532,11 +567,13 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC tsOutputChannels->atmospherePressure = getBaroPressure(); tsOutputChannels->manifold_air_pressure = getMap(); tsOutputChannels->engineLoad = engineLoad; - tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration(); + tsOutputChannels->rpmAcceleration = + engine->rpmCalculator.getRpmAcceleration(); tsOutputChannels->checkEngine = hasErrorCodes(); #if EFI_PROD_CODE - tsOutputChannels->egtValues.values[0] = getEgtValue(0); + for (int i = 0; i < EGT_CHANNEL_COUNT; i++) + tsOutputChannels->egtValues.values[i] = getEgtValue(i); tsOutputChannels->needBurn = getNeedToWriteConfiguration(); tsOutputChannels->hasSdCard = isSdCardAlive(); @@ -544,13 +581,19 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC tsOutputChannels->isFanOn = enginePins.fanRelay.getLogicValue(); tsOutputChannels->isO2HeaterOn = enginePins.o2heater.getLogicValue(); tsOutputChannels->ignition_enabled = engineConfiguration->isIgnitionEnabled; - tsOutputChannels->injection_enabled = engineConfiguration->isInjectionEnabled; - tsOutputChannels->cylinder_cleanup_enabled = engineConfiguration->isCylinderCleanupEnabled; - tsOutputChannels->cylinder_cleanup_activated = engine->isCylinderCleanupMode; - tsOutputChannels->secondTriggerChannelEnabled = engineConfiguration->secondTriggerChannelEnabled; + tsOutputChannels->injection_enabled = + engineConfiguration->isInjectionEnabled; + tsOutputChannels->cylinder_cleanup_enabled = + engineConfiguration->isCylinderCleanupEnabled; + tsOutputChannels->cylinder_cleanup_activated = + engine->isCylinderCleanupMode; + tsOutputChannels->secondTriggerChannelEnabled = + engineConfiguration->secondTriggerChannelEnabled; tsOutputChannels->vehicleSpeedKph = getVehicleSpeed(); - tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature(engine)); - tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature(engine)); + tsOutputChannels->isCltError = !isValidCoolantTemperature( + getCoolantTemperature(engine)); + tsOutputChannels->isIatError = !isValidIntakeAirTemperature( + getIntakeAirTemperature(engine)); #endif tsOutputChannels->clutchUpState = engine->clutchUpState; tsOutputChannels->clutchDownState = engine->clutchDownState; @@ -559,7 +602,8 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC tsOutputChannels->inj_adv = timing > 360 ? timing - 720 : timing; tsOutputChannels->sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER); tsOutputChannels->baseFuel = baseFuelMs; - tsOutputChannels->pulseWidthMs = getRunningFuel(baseFuelMs, rpm PASS_ENGINE_PARAMETER); + tsOutputChannels->pulseWidthMs = getRunningFuel(baseFuelMs, + rpm PASS_ENGINE_PARAMETER); tsOutputChannels->crankingFuelMs = getCrankingFuel(engine); } @@ -587,7 +631,8 @@ static void unsubscribe(int outputOrdinal) { void initStatusLoop(Engine *engine) { #if EFI_PROD_CODE || EFI_SIMULATOR - initLoggingExt(&logger, "status loop", LOGGING_BUFFER, sizeof(LOGGING_BUFFER)); + initLoggingExt(&logger, "status loop", LOGGING_BUFFER, + sizeof(LOGGING_BUFFER)); #endif /* EFI_PROD_CODE || EFI_SIMULATOR */ setFullLog(INITIAL_FULL_LOG); @@ -598,7 +643,8 @@ void initStatusLoop(Engine *engine) { initLogging(&logger2, "main event handler"); #if EFI_ENGINE_CONTROL - addConsoleActionFFP("fuelinfo2", (VoidFloatFloatVoidPtr) showFuelInfo2, engine); + addConsoleActionFFP("fuelinfo2", (VoidFloatFloatVoidPtr) showFuelInfo2, + engine); addConsoleActionP("fuelinfo", (VoidPtr) showFuelInfo, engine); #endif @@ -618,11 +664,14 @@ void initStatusLoop(Engine *engine) { void startStatusThreads(Engine *engine) { // todo: refactoring needed, this file should probably be split into pieces - chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, (tfunc_t) lcdThread, engine); - chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, (tfunc_t) tsStatusThread, engine); + chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, + (tfunc_t) lcdThread, engine); + chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, + (tfunc_t) tsStatusThread, engine); #if EFI_PROD_CODE || defined(__DOXYGEN__) initStatisLeds(); - chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, (tfunc_t) blinkingThread, NULL); + chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, + (tfunc_t) blinkingThread, NULL); #endif /* EFI_PROD_CODE */ } diff --git a/firmware/console/tunerstudio/tunerstudio_configuration.h b/firmware/console/tunerstudio/tunerstudio_configuration.h index 09d4eae6b6..56051b14ff 100644 --- a/firmware/console/tunerstudio/tunerstudio_configuration.h +++ b/firmware/console/tunerstudio/tunerstudio_configuration.h @@ -11,6 +11,8 @@ #ifndef TUNERSTUDIO_CONFIGURATION_H_ #define TUNERSTUDIO_CONFIGURATION_H_ +#include "rusefi_types.h" + /** * this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version */ @@ -19,8 +21,6 @@ #define PAGE_0_SIZE 11832 #define TS_OUTPUT_SIZE 116 -#define EGT_CHANNEL_COUNT 8 - typedef struct { uint16_t values[EGT_CHANNEL_COUNT]; } egt_values_s; diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 131446b7db..0b02a31094 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -375,7 +375,7 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_ boardConfiguration->triggerErrorPin = GPIO_UNASSIGNED; boardConfiguration->max31855spiDevice = SPI_NONE; - for (int i = 0; i < MAX31855_CS_COUNT; i++) { + for (int i = 0; i < EGT_CHANNEL_COUNT; i++) { boardConfiguration->max31855_cs[i] = GPIO_UNASSIGNED; } for (int i = 0; i < LE_COMMAND_COUNT; i++) { diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 2edb0f0bb8..26afd52c25 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 by config_definition.jar on Mon Feb 02 22:51:59 EST 2015 +// this section was generated by config_definition.jar on Sat Feb 07 09:06:02 BOT 2015 // begin #include "rusefi_types.h" typedef struct { @@ -449,7 +449,7 @@ typedef struct { /** * offset 404 */ - brain_pin_e max31855_cs[MAX31855_CS_COUNT]; + brain_pin_e max31855_cs[EGT_CHANNEL_COUNT]; /** * offset 436 */ @@ -1130,4 +1130,4 @@ typedef struct { } engine_configuration_s; // end -// this section was generated by config_definition.jar on Mon Feb 02 22:51:59 EST 2015 +// this section was generated by config_definition.jar on Sat Feb 07 09:06:02 BOT 2015 diff --git a/firmware/controllers/algo/rusefi_types.h b/firmware/controllers/algo/rusefi_types.h index 824b80a24b..b138733e61 100644 --- a/firmware/controllers/algo/rusefi_types.h +++ b/firmware/controllers/algo/rusefi_types.h @@ -40,7 +40,7 @@ typedef void (*Void)(void); #define INJECTION_PIN_COUNT 12 #define IGNITION_PIN_COUNT 12 -#define MAX31855_CS_COUNT 8 +#define EGT_CHANNEL_COUNT 8 #define JOYSTICK_PIN_COUNT 5 @@ -54,7 +54,7 @@ typedef char le_formula_t[LE_COMMAND_LENGTH]; #define HW_MAX_ADC_INDEX 16 -typedef brain_pin_e egt_cs_array_t[MAX31855_CS_COUNT]; +typedef brain_pin_e egt_cs_array_t[EGT_CHANNEL_COUNT]; #define MAP_ANGLE_SIZE 8 #define MAP_WINDOW_SIZE 8 diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index a0bc5d6c5b..44d3cc6071 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -631,7 +631,7 @@ static void setTriggerSimulatorMode(const char *indexStr, const char *modeCode) static void setEgtCSPin(const char *indexStr, const char *pinName, board_configuration_s * board_configuration_s) { int index = atoi(indexStr); - if (index < 0 || index >= MAX31855_CS_COUNT || absI(index) == ERROR_CODE) + if (index < 0 || index >= EGT_CHANNEL_COUNT || absI(index) == ERROR_CODE) return; brain_pin_e pin = parseBrainPin(pinName); if (pin == GPIO_INVALID) { diff --git a/firmware/hw_layer/max31855.cpp b/firmware/hw_layer/max31855.cpp index 42b6d2297c..d65d64528b 100644 --- a/firmware/hw_layer/max31855.cpp +++ b/firmware/hw_layer/max31855.cpp @@ -31,7 +31,7 @@ static SPIDriver *driver; static Logging* logger; -static SPIConfig spiConfig[MAX31855_CS_COUNT]; +static SPIConfig spiConfig[EGT_CHANNEL_COUNT]; EXTERN_ENGINE; @@ -41,7 +41,7 @@ static void showEgtInfo(void) { scheduleMsg(logger, "EGT spi: %d", boardConfiguration->max31855spiDevice); - for (int i = 0; i < MAX31855_CS_COUNT; i++) { + for (int i = 0; i < EGT_CHANNEL_COUNT; i++) { if (boardConfiguration->max31855_cs[i] != GPIO_UNASSIGNED) { scheduleMsg(logger, "%d ETG @ %s", i, hwPortname(boardConfiguration->max31855_cs[i])); } @@ -154,7 +154,7 @@ void initMax31855(Logging *sharedLogger, SPIDriver *drv, egt_cs_array_t max31855 turnOnSpi(SPI_DEVICE_3); #endif /* EFI_PROD_CODE */ - for (int i = 0; i < MAX31855_CS_COUNT; i++) { + for (int i = 0; i < EGT_CHANNEL_COUNT; i++) { if (max31855_cs[i] != GPIO_UNASSIGNED) { initSpiCs(&spiConfig[i], max31855_cs[i]); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 73f8f525b9..ec944df85c 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -259,5 +259,5 @@ int getRusEfiVersion(void) { return 1; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE == 0) return 1; // this is here to make the compiler happy about the unused array - return 20150205; + return 20150207; } diff --git a/firmware/rusefi_config.ini b/firmware/rusefi_config.ini index 5c0b8848e9..56d1d733bc 100644 --- a/firmware/rusefi_config.ini +++ b/firmware/rusefi_config.ini @@ -22,7 +22,7 @@ struct engine_configuration_s #define IGN_RPM_COUNT 16 #define INJECTION_PIN_COUNT 12 #define IGNITION_PIN_COUNT 12 -#define MAX31855_CS_COUNT 8 +#define EGT_CHANNEL_COUNT 8 #define JOYSTICK_PIN_COUNT 5 #define DIGIPOT_COUNT 4 #define HW_MAX_ADC_INDEX 16 @@ -355,7 +355,7 @@ bit is_enabled_spi_2 pin_output_mode_e mainRelayPinMode; - brain_pin_e[MAX31855_CS_COUNT iterate] max31855_cs; + brain_pin_e[EGT_CHANNEL_COUNT iterate] max31855_cs; spi_device_e max31855spiDevice; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index d44f2ba744..66a0b491c6 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -37,7 +37,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated by ConfigDefinition.jar on Fri Feb 06 12:41:15 BOT 2015 +; this section was generated by ConfigDefinition.jar on Sat Feb 07 09:06:03 BOT 2015 pageSize = 11832 page = 1 @@ -554,8 +554,14 @@ fileVersion = { 20150202 } ind_map_error = bits, U32, 80, [2:2], "true", "false"; ind_iat_error = bits, U32, 80, [3:3], "true", "false"; firmwareTsVersion = scalar,U32, 84, "version", 1, 0 - egt0 = scalar, S16, 88, "°C", 1, 0 - egt1 = scalar, S16, 90, "°C", 1, 0 + egt1 = scalar, S16, 88, "°C", 1, 0 + egt2 = scalar, S16, 90, "°C", 1, 0 + egt3 = scalar, S16, 92, "°C", 1, 0 + egt4 = scalar, S16, 94, "°C", 1, 0 + egt5 = scalar, S16, 96, "°C", 1, 0 + egt6 = scalar, S16, 98, "°C", 1, 0 + egt7 = scalar, S16, 100, "°C", 1, 0 + egt8 = scalar, S16, 102, "°C", 1, 0 rpmAcceleration = scalar, F32, 104, "dRpm", 1, 0 egoCorrection = { 1 } time = { timeNow } @@ -691,7 +697,14 @@ fileVersion = { 20150202 } ; warmupEnrichGauge = warmupEnrich, "Warmup Enrichment", "%", 100, 150, -1, -1, 101, 105, 0, 0 ; accelEnrichGauge = accDecEnrich, "Accel Enrich", "%", 50, 150, -1, -1, 999, 999, 0, 0 dwellGauge = sparkDwell, "Dwell", "mSec", 0, 10, 0.5, 1.0, 6.0, 8.0, 1, 1 - egt0Gauge = egt0, "EGT#0", "C", 0, 2000 + egt1Gauge = egt1, "EGT#1", "C", 0, 2000 + egt2Gauge = egt2, "EGT#2", "C", 0, 2000 + egt3Gauge = egt3, "EGT#3", "C", 0, 2000 + egt4Gauge = egt4, "EGT#4", "C", 0, 2000 + egt5Gauge = egt5, "EGT#5", "C", 0, 2000 + egt6Gauge = egt6, "EGT#6", "C", 0, 2000 + egt7Gauge = egt7, "EGT#7", "C", 0, 2000 + egt8Gauge = egt8, "EGT#8", "C", 0, 2000 vssGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1 rpmAccelerationGa = rpmAcceleration, "rpm d", "dRpm", 0, 3, 0, 1, 3, 4, 1, 1 @@ -763,8 +776,6 @@ fileVersion = { 20150202 } ; tCharge = F32, "T", ; sparkDwell = F32, "MAP", ; warmUpEnrich = F32, "%", -; egt0 = S16, "°C", -; egt1 = S16, "°C", [Menu]