auto-sync
This commit is contained in:
parent
57dbdec8f3
commit
5b8c8c08d6
|
@ -39,8 +39,8 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// set_global_trigger_offset_angle 84
|
||||
engineConfiguration->globalTriggerAngleOffset = 84;
|
||||
|
||||
setWholeFuelMap(engineConfiguration, 6);
|
||||
setWholeTimingTable(engineConfiguration, 10);
|
||||
setWholeFuelMap(6 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
|
||||
|
||||
board_configuration_s *bc = &engineConfiguration->bc;
|
||||
bc->malfunctionIndicatorPin = GPIO_UNASSIGNED;
|
||||
|
|
|
@ -201,7 +201,7 @@ void setCitroenBerlingoTU3JPConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
*/
|
||||
// engineConfiguration->mafAdcChannel = GPIO_UNASSIGNED;
|
||||
|
||||
copyFuelTable(tps_fuel_table, engineConfiguration->fuelTable);
|
||||
copyTimingTable(tps_advance_table, engineConfiguration->ignitionTable);
|
||||
copyFuelTable(tps_fuel_table, config->fuelTable);
|
||||
copyTimingTable(tps_advance_table, config->ignitionTable);
|
||||
|
||||
}
|
||||
|
|
|
@ -113,8 +113,8 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
*/
|
||||
|
||||
// set_whole_fuel_map 9
|
||||
setWholeFuelMap(engineConfiguration, 9);
|
||||
setWholeTimingTable(engineConfiguration, 12);
|
||||
setWholeFuelMap(9 PASS_ENGINE_PARAMETER);
|
||||
setWholeTimingTable(12 PASS_ENGINE_PARAMETER);
|
||||
|
||||
// set_cranking_injection_mode 0
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
@ -216,10 +216,10 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
*
|
||||
* set_whole_fuel_map 12
|
||||
*/
|
||||
//setWholeFuelMap(engineConfiguration, 12);
|
||||
copyFuelTable(alphaNfuel, engineConfiguration->fuelTable);
|
||||
//setWholeTimingTable(engineConfiguration, 12);
|
||||
copyTimingTable(fromDyno, engineConfiguration->ignitionTable);
|
||||
//setWholeFuelMap(12 PASS_ENGINE_PARAMETER);
|
||||
copyFuelTable(alphaNfuel, config->fuelTable);
|
||||
//setWholeTimingTable(12 PASS_ENGINE_PARAMETER);
|
||||
copyTimingTable(fromDyno, config->ignitionTable);
|
||||
|
||||
// set_cranking_charge_angle 70
|
||||
engineConfiguration->crankingChargeAngle = 70;
|
||||
|
|
|
@ -73,8 +73,8 @@ static void setDefaultAspireMaps(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
|
||||
setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
|
||||
|
||||
copyFuelTable(default_aspire_fuel_table, engineConfiguration->fuelTable);
|
||||
copyTimingTable(default_aspire_timing_table, engineConfiguration->ignitionTable);
|
||||
copyFuelTable(default_aspire_fuel_table, config->fuelTable);
|
||||
copyTimingTable(default_aspire_timing_table, config->ignitionTable);
|
||||
}
|
||||
|
||||
void setFordAspireEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
|
|
|
@ -35,10 +35,10 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->crankingChargeAngle = 70;
|
||||
|
||||
// set_whole_fuel_map 9
|
||||
setWholeFuelMap(engineConfiguration, 9);
|
||||
setWholeFuelMap(9 PASS_ENGINE_PARAMETER);
|
||||
|
||||
// set_whole_timing_map 10
|
||||
setWholeTimingTable(engineConfiguration, 10);
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
|
||||
|
||||
// http://i.imgur.com/fclVzvu.jpg
|
||||
setCommonNTCSensor(&engineConfiguration->clt);
|
||||
|
|
|
@ -295,9 +295,9 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->crankingTimingAngle = 3;
|
||||
engineConfiguration->crankingChargeAngle = 70;
|
||||
|
||||
setWholeTimingTable(engineConfiguration, 10);
|
||||
setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
|
||||
// set_whole_fuel_map 5
|
||||
setWholeFuelMap(engineConfiguration, 5);
|
||||
setWholeFuelMap(5 PASS_ENGINE_PARAMETER);
|
||||
|
||||
setSingleCoilDwell(engineConfiguration);
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
|
@ -372,9 +372,9 @@ static void setMiata1994_common(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
engineConfiguration->crankingChargeAngle = 70;
|
||||
|
||||
copyFuelTable(miata_maf_fuel_table, engineConfiguration->fuelTable);
|
||||
copyFuelTable(miata_maf_fuel_table, config->fuelTable);
|
||||
|
||||
copyTimingTable(miata_maf_advance_table, engineConfiguration->ignitionTable);
|
||||
copyTimingTable(miata_maf_advance_table, config->ignitionTable);
|
||||
|
||||
// boardConfiguration->triggerSimulatorPins[0] = GPIOD_2; // 2G - YEL/BLU
|
||||
// boardConfiguration->triggerSimulatorPins[1] = GPIOB_3; // 2E - WHT - four times
|
||||
|
@ -501,8 +501,8 @@ void setMiata1996(DECLARE_ENGINE_PARAMETER_F) {
|
|||
commonMiataNa(PASS_ENGINE_PARAMETER_F);
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
|
||||
copyFuelTable(miata_maf_fuel_table, engineConfiguration->fuelTable);
|
||||
copyTimingTable(miata_maf_advance_table, engineConfiguration->ignitionTable);
|
||||
copyFuelTable(miata_maf_fuel_table, config->fuelTable);
|
||||
copyTimingTable(miata_maf_advance_table, config->ignitionTable);
|
||||
|
||||
// upside down
|
||||
boardConfiguration->triggerInputPins[0] = GPIOA_5;
|
||||
|
|
|
@ -74,7 +74,7 @@ void setMazdaMiataNbEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->clutchDownPin = GPIO_UNASSIGNED;
|
||||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(engineConfiguration, 3);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
|
||||
|
||||
// 10 deg before TDC is default timing
|
||||
|
|
|
@ -39,7 +39,7 @@ void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->crankingTimingAngle = -715;
|
||||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(engineConfiguration, 3);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
|
||||
// set_cranking_fuel 4
|
||||
engineConfiguration->cranking.baseFuel = 4;
|
||||
|
|
|
@ -41,7 +41,7 @@ void setRoverv8(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->cranking.rpm = 550;
|
||||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(engineConfiguration, 3);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
|
||||
// set_cranking_injection_mode 0
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
|
|
@ -167,6 +167,16 @@ char *getWorkingPageAddr(int pageIndex) {
|
|||
return (char*) &configWorkingCopy.engineConfiguration;
|
||||
case 1:
|
||||
return (char*) &configWorkingCopy.ve2Table;
|
||||
case 2:
|
||||
return (char*) &configWorkingCopy.fuelTable;
|
||||
case 3:
|
||||
return (char*) &configWorkingCopy.ignitionTable;
|
||||
case 4:
|
||||
return (char*) &configWorkingCopy.veTable;
|
||||
case 5:
|
||||
return (char*) &configWorkingCopy.afrTable;
|
||||
case 6:
|
||||
return (char*) &configWorkingCopy.injectionPhase;
|
||||
// case 2: // fuelTable
|
||||
// case 3: // ignitionTable
|
||||
// case 4: // veTable
|
||||
|
@ -181,6 +191,11 @@ int getTunerStudioPageSize(int pageIndex) {
|
|||
case 0:
|
||||
return PAGE_0_SIZE;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return PAGE_1_SIZE;
|
||||
// case 2:
|
||||
// case 3:
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
*/
|
||||
#define TS_FILE_VERSION 20150216
|
||||
|
||||
#define PAGE_COUNT 2
|
||||
#define PAGE_COUNT 7
|
||||
|
||||
#define PAGE_0_SIZE 14008
|
||||
#define PAGE_0_SIZE 8248
|
||||
#define PAGE_1_SIZE 1152
|
||||
|
||||
#define TS_OUTPUT_SIZE 196
|
||||
|
|
|
@ -58,6 +58,6 @@ float getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
|||
}
|
||||
|
||||
void prepareTimingMap(DECLARE_ENGINE_PARAMETER_F) {
|
||||
advanceMap.init(engineConfiguration->ignitionTable, engineConfiguration->ignitionLoadBins,
|
||||
engineConfiguration->ignitionRpmBins);
|
||||
advanceMap.init(config->ignitionTable, config->ignitionLoadBins,
|
||||
config->ignitionRpmBins);
|
||||
}
|
||||
|
|
|
@ -112,19 +112,19 @@ void setMap(fuel_table_t table, float value) {
|
|||
}
|
||||
}
|
||||
|
||||
static void setWholeVEMap(engine_configuration_s *engineConfiguration, float value) {
|
||||
setMap(engineConfiguration->veTable, value);
|
||||
static void setWholeVEMap(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
setMap(config->veTable, value);
|
||||
}
|
||||
|
||||
void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value) {
|
||||
setMap(engineConfiguration->fuelTable, value);
|
||||
void setWholeFuelMap(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
setMap(config->fuelTable, value);
|
||||
}
|
||||
|
||||
void setWholeTimingTable(engine_configuration_s *engineConfiguration, float value) {
|
||||
void setWholeTimingTable(float value DECLARE_ENGINE_PARAMETER_S) {
|
||||
// todo: table helper?
|
||||
for (int l = 0; l < IGN_LOAD_COUNT; l++) {
|
||||
for (int r = 0; r < IGN_RPM_COUNT; r++) {
|
||||
engineConfiguration->ignitionTable[l][r] = value;
|
||||
config->ignitionTable[l][r] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,8 +136,7 @@ void setWholeTimingTable(engine_configuration_s *engineConfiguration, float valu
|
|||
*/
|
||||
void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||
board_configuration_s *boardConfiguration = &engineConfiguration->bc;
|
||||
memset(engineConfiguration, 0, sizeof(engine_configuration_s));
|
||||
memset(boardConfiguration, 0, sizeof(board_configuration_s));
|
||||
memset(config, 0, sizeof(persistent_config_s));
|
||||
|
||||
setDetaultVETable(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
|
@ -191,13 +190,13 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setTableBin2(engineConfiguration->map.samplingWindow, MAP_ANGLE_SIZE, 50, 50, 1);
|
||||
|
||||
// set_whole_timing_map 3
|
||||
setWholeFuelMap(engineConfiguration, 3);
|
||||
setWholeVEMap(engineConfiguration, 0.8);
|
||||
setMap(engineConfiguration->afrTable, 14.7);
|
||||
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
||||
setWholeVEMap(0.8 PASS_ENGINE_PARAMETER);
|
||||
setMap(config->afrTable, 14.7);
|
||||
|
||||
setMap(engineConfiguration->injectionPhase, -180);
|
||||
setRpmTableBin(engineConfiguration->injPhaseRpmBins, FUEL_RPM_COUNT);
|
||||
setTableBin2(engineConfiguration->injPhaseLoadBins, FUEL_LOAD_COUNT, 10, 300, 1);
|
||||
setMap(config->injectionPhase, -180);
|
||||
setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT);
|
||||
setTableBin2(config->injPhaseLoadBins, FUEL_LOAD_COUNT, 10, 300, 1);
|
||||
|
||||
setThermistorConfiguration(&engineConfiguration->clt, 0, 9500, 23.8889, 2100, 48.8889, 1000);
|
||||
engineConfiguration->clt.bias_resistor = 1500;
|
||||
|
|
|
@ -42,15 +42,29 @@ typedef struct {
|
|||
engine_configuration_s engineConfiguration;
|
||||
|
||||
ve_table_t ve2Table;
|
||||
/**
|
||||
* offset 15032
|
||||
*/
|
||||
float ve2LoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* offset 15096
|
||||
*/
|
||||
float ve2RpmBins[FUEL_RPM_COUNT];
|
||||
|
||||
fuel_table_t fuelTable;
|
||||
float fuelLoadBins[FUEL_LOAD_COUNT];
|
||||
float fuelRpmBins[FUEL_RPM_COUNT];
|
||||
|
||||
ignition_table_t ignitionTable;
|
||||
float ignitionLoadBins[IGN_LOAD_COUNT];
|
||||
float ignitionRpmBins[IGN_RPM_COUNT];
|
||||
|
||||
ve_table_t veTable;
|
||||
float veLoadBins[FUEL_LOAD_COUNT];
|
||||
float veRpmBins[FUEL_RPM_COUNT];
|
||||
|
||||
afr_table_t afrTable;
|
||||
float afrLoadBins[FUEL_LOAD_COUNT];
|
||||
float afrRpmBins[FUEL_RPM_COUNT];
|
||||
|
||||
fuel_table_t injectionPhase;
|
||||
float injPhaseLoadBins[FUEL_LOAD_COUNT];
|
||||
float injPhaseRpmBins[FUEL_RPM_COUNT];
|
||||
|
||||
} persistent_config_s;
|
||||
|
||||
typedef struct {
|
||||
|
@ -62,8 +76,8 @@ typedef struct {
|
|||
|
||||
void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F);
|
||||
void setMap(fuel_table_t table, float value);
|
||||
void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value);
|
||||
void setWholeTimingTable(engine_configuration_s *engineConfiguration, float value);
|
||||
void setWholeFuelMap(float value DECLARE_ENGINE_PARAMETER_S);
|
||||
void setWholeTimingTable(float value DECLARE_ENGINE_PARAMETER_S);
|
||||
void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs);
|
||||
void printFloatArray(const char *prefix, float array[], int size);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// this section was generated by config_definition.jar on Fri Feb 27 21:32:08 EST 2015
|
||||
// this section was generated by config_definition.jar on Fri Feb 27 21:57:35 EST 2015
|
||||
// begin
|
||||
#include "rusefi_types.h"
|
||||
typedef struct {
|
||||
|
@ -1107,69 +1107,8 @@ typedef struct {
|
|||
* offset 7224
|
||||
*/
|
||||
float mafDecodingBins[MAF_DECODING_COUNT];
|
||||
/**
|
||||
* offset 8248
|
||||
*/
|
||||
fuel_table_t fuelTable;
|
||||
/**
|
||||
* offset 9272
|
||||
*/
|
||||
float fuelLoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* RPM is float and not integer in order to use unified methods for interpolation
|
||||
* offset 9336
|
||||
*/
|
||||
float fuelRpmBins[FUEL_RPM_COUNT];
|
||||
/**
|
||||
* offset 9400
|
||||
*/
|
||||
ignition_table_t ignitionTable;
|
||||
/**
|
||||
* offset 10424
|
||||
*/
|
||||
float ignitionLoadBins[IGN_LOAD_COUNT];
|
||||
/**
|
||||
* offset 10488
|
||||
*/
|
||||
float ignitionRpmBins[IGN_RPM_COUNT];
|
||||
/**
|
||||
* offset 10552
|
||||
*/
|
||||
ve_table_t veTable;
|
||||
/**
|
||||
* offset 11576
|
||||
*/
|
||||
float veLoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* offset 11640
|
||||
*/
|
||||
float veRpmBins[FUEL_RPM_COUNT];
|
||||
/**
|
||||
* offset 11704
|
||||
*/
|
||||
afr_table_t afrTable;
|
||||
/**
|
||||
* offset 12728
|
||||
*/
|
||||
float afrLoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* offset 12792
|
||||
*/
|
||||
float afrRpmBins[FUEL_RPM_COUNT];
|
||||
/**
|
||||
* offset 12856
|
||||
*/
|
||||
fuel_table_t injectionPhase;
|
||||
/**
|
||||
* offset 13880
|
||||
*/
|
||||
float injPhaseLoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* offset 13944
|
||||
*/
|
||||
float injPhaseRpmBins[FUEL_RPM_COUNT];
|
||||
/** total size 14008*/
|
||||
/** total size 8248*/
|
||||
} engine_configuration_s;
|
||||
|
||||
// end
|
||||
// this section was generated by config_definition.jar on Fri Feb 27 21:32:08 EST 2015
|
||||
// this section was generated by config_definition.jar on Fri Feb 27 21:57:35 EST 2015
|
||||
|
|
|
@ -155,8 +155,8 @@ float getInjectorLag(float vBatt DECLARE_ENGINE_PARAMETER_S) {
|
|||
* is to prepare the fuel map data structure for 3d interpolation
|
||||
*/
|
||||
void prepareFuelMap(DECLARE_ENGINE_PARAMETER_F) {
|
||||
fuelMap.init(engineConfiguration->fuelTable, engineConfiguration->fuelLoadBins, engineConfiguration->fuelRpmBins);
|
||||
fuelPhaseMap.init(engineConfiguration->injectionPhase, engineConfiguration->injPhaseLoadBins, engineConfiguration->injPhaseRpmBins);
|
||||
fuelMap.init(config->fuelTable, config->fuelLoadBins, config->fuelRpmBins);
|
||||
fuelPhaseMap.init(config->injectionPhase, config->injPhaseLoadBins, config->injPhaseRpmBins);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "engine_configuration.h"
|
||||
#include "engine.h"
|
||||
|
||||
#define FLASH_DATA_VERSION 6667
|
||||
#define FLASH_DATA_VERSION 7174
|
||||
|
||||
void readFromFlash(void);
|
||||
void initFlash(Logging *sharedLogger, Engine *engine);
|
||||
|
|
|
@ -367,19 +367,19 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_F) {
|
|||
#endif
|
||||
|
||||
void setFuelRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
setTableBin(engineConfiguration->fuelRpmBins, FUEL_RPM_COUNT, from, to);
|
||||
setTableBin(config->fuelRpmBins, FUEL_RPM_COUNT, from, to);
|
||||
}
|
||||
|
||||
void setFuelLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
setTableBin(engineConfiguration->fuelLoadBins, FUEL_LOAD_COUNT, from, to);
|
||||
setTableBin(config->fuelLoadBins, FUEL_LOAD_COUNT, from, to);
|
||||
}
|
||||
|
||||
void setTimingRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
setTableBin(engineConfiguration->ignitionRpmBins, IGN_RPM_COUNT, from, to);
|
||||
setTableBin(config->ignitionRpmBins, IGN_RPM_COUNT, from, to);
|
||||
}
|
||||
|
||||
void setTimingLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
setTableBin(engineConfiguration->ignitionLoadBins, IGN_LOAD_COUNT, from, to);
|
||||
setTableBin(config->ignitionLoadBins, IGN_LOAD_COUNT, from, to);
|
||||
}
|
||||
|
||||
int isInjectionEnabled(engine_configuration_s *engineConfiguration) {
|
||||
|
|
|
@ -93,23 +93,23 @@ float getSpeedDensityFuel(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
}
|
||||
|
||||
void setDetaultVETable(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setRpmTableBin(engineConfiguration->veRpmBins, FUEL_RPM_COUNT);
|
||||
setTableBin2(engineConfiguration->veLoadBins, FUEL_LOAD_COUNT, 10, 300, 1);
|
||||
setRpmTableBin(config->veRpmBins, FUEL_RPM_COUNT);
|
||||
setTableBin2(config->veLoadBins, FUEL_LOAD_COUNT, 10, 300, 1);
|
||||
veMap.setAll(0.8);
|
||||
|
||||
setRpmTableBin(config->ve2RpmBins, FUEL_RPM_COUNT);
|
||||
setTableBin2(config->ve2LoadBins, FUEL_LOAD_COUNT, 10, 300, 1);
|
||||
ve2Map.setAll(0.81);
|
||||
|
||||
setRpmTableBin(engineConfiguration->afrRpmBins, FUEL_RPM_COUNT);
|
||||
setTableBin2(engineConfiguration->afrLoadBins, FUEL_LOAD_COUNT, 10, 300, 1);
|
||||
setRpmTableBin(config->afrRpmBins, FUEL_RPM_COUNT);
|
||||
setTableBin2(config->afrLoadBins, FUEL_LOAD_COUNT, 10, 300, 1);
|
||||
afrMap.setAll(14.7);
|
||||
}
|
||||
|
||||
void initSpeedDensity(DECLARE_ENGINE_PARAMETER_F) {
|
||||
efiAssertVoid(config!=NULL, "config is NULL");
|
||||
engine_configuration_s *e = &config->engineConfiguration;
|
||||
veMap.init(e->veTable, e->veLoadBins, e->veRpmBins);
|
||||
veMap.init(config->veTable, config->veLoadBins, config->veRpmBins);
|
||||
ve2Map.init(config->ve2Table, config->ve2LoadBins, config->ve2RpmBins);
|
||||
afrMap.init(e->afrTable, e->afrLoadBins, e->afrRpmBins);
|
||||
afrMap.init(config->afrTable, config->afrLoadBins, config->afrRpmBins);
|
||||
}
|
||||
|
|
|
@ -195,9 +195,9 @@ void printConfiguration(engine_configuration_s *engineConfiguration) {
|
|||
// print("\r\n");
|
||||
}
|
||||
|
||||
printFloatArray("RPM bin: ", engineConfiguration->fuelRpmBins, FUEL_RPM_COUNT);
|
||||
printFloatArray("RPM bin: ", config->fuelRpmBins, FUEL_RPM_COUNT);
|
||||
|
||||
printFloatArray("Y bin: ", engineConfiguration->fuelLoadBins, FUEL_LOAD_COUNT);
|
||||
printFloatArray("Y bin: ", config->fuelLoadBins, FUEL_LOAD_COUNT);
|
||||
|
||||
printFloatArray("CLT: ", engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE);
|
||||
printFloatArray("CLT bins: ", engineConfiguration->cltFuelCorrBins, CLT_CURVE_SIZE);
|
||||
|
@ -532,14 +532,14 @@ static void setWholeTimingMap(float value) {
|
|||
scheduleMsg(&logger, "Setting whole timing map to %f", value);
|
||||
for (int l = 0; l < IGN_LOAD_COUNT; l++) {
|
||||
for (int r = 0; r < IGN_RPM_COUNT; r++) {
|
||||
engineConfiguration->ignitionTable[l][r] = value;
|
||||
config->ignitionTable[l][r] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void setWholePhaseMapCmd(float value) {
|
||||
scheduleMsg(&logger, "Setting whole injection phase map to %f", value);
|
||||
setMap(engineConfiguration->injectionPhase, value);
|
||||
setMap(config->injectionPhase, value);
|
||||
}
|
||||
|
||||
static void setWholeTimingMapCmd(float value) {
|
||||
|
@ -552,7 +552,7 @@ static void setWholeFuelMapCmd(float value) {
|
|||
if (engineConfiguration->algorithm == LM_SPEED_DENSITY) {
|
||||
scheduleMsg(&logger, "WARNING: setting fuel map in SD mode is pointless");
|
||||
}
|
||||
setWholeFuelMap(engineConfiguration, value);
|
||||
setWholeFuelMap(value PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
|
@ -726,12 +726,12 @@ static void setTimingMap(const char * rpmStr, const char *loadStr, const char *v
|
|||
float engineLoad = atoff(loadStr);
|
||||
float value = atoff(valueStr);
|
||||
|
||||
int rpmIndex = findIndex(engineConfiguration->ignitionRpmBins, IGN_RPM_COUNT, rpm);
|
||||
int rpmIndex = findIndex(config->ignitionRpmBins, IGN_RPM_COUNT, rpm);
|
||||
rpmIndex = rpmIndex < 0 ? 0 : rpmIndex;
|
||||
int loadIndex = findIndex(engineConfiguration->ignitionLoadBins, IGN_LOAD_COUNT, engineLoad);
|
||||
int loadIndex = findIndex(config->ignitionLoadBins, IGN_LOAD_COUNT, engineLoad);
|
||||
loadIndex = loadIndex < 0 ? 0 : loadIndex;
|
||||
|
||||
engineConfiguration->ignitionTable[loadIndex][rpmIndex] = value;
|
||||
config->ignitionTable[loadIndex][rpmIndex] = value;
|
||||
scheduleMsg(&logger, "Setting timing map entry %d:%d to %f", rpmIndex, loadIndex, value);
|
||||
}
|
||||
|
||||
|
@ -740,12 +740,12 @@ static void setFuelMap(const char * rpmStr, const char *loadStr, const char *val
|
|||
float engineLoad = atoff(loadStr);
|
||||
float value = atoff(valueStr);
|
||||
|
||||
int rpmIndex = findIndex(engineConfiguration->fuelRpmBins, FUEL_RPM_COUNT, rpm);
|
||||
int rpmIndex = findIndex(config->fuelRpmBins, FUEL_RPM_COUNT, rpm);
|
||||
rpmIndex = rpmIndex < 0 ? 0 : rpmIndex;
|
||||
int loadIndex = findIndex(engineConfiguration->fuelLoadBins, FUEL_LOAD_COUNT, engineLoad);
|
||||
int loadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, engineLoad);
|
||||
loadIndex = loadIndex < 0 ? 0 : loadIndex;
|
||||
|
||||
engineConfiguration->fuelTable[loadIndex][rpmIndex] = value;
|
||||
config->fuelTable[loadIndex][rpmIndex] = value;
|
||||
scheduleMsg(&logger, "Setting fuel map entry %d:%d to %f", rpmIndex, loadIndex, value);
|
||||
}
|
||||
|
||||
|
|
|
@ -485,25 +485,25 @@ float[MAF_DECODING_COUNT] mafDecoding;kg/hour value.\nBy the way 2.081989116 kg/
|
|||
float[MAF_DECODING_COUNT] mafDecodingBins;; "V", 1, 0, -5.0, 150.0, 2
|
||||
|
||||
|
||||
fuel_table_t fuelTable;
|
||||
float[FUEL_LOAD_COUNT] fuelLoadBins;;"V", 1, 0, 0.0, 300.0, 2
|
||||
float[FUEL_RPM_COUNT] fuelRpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0.0, 25500.0, 2
|
||||
! fuel_table_t fuelTable;
|
||||
! float[FUEL_LOAD_COUNT] fuelLoadBins;;"V", 1, 0, 0.0, 300.0, 2
|
||||
! float[FUEL_RPM_COUNT] fuelRpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0.0, 25500.0, 2
|
||||
|
||||
ignition_table_t ignitionTable;
|
||||
float[IGN_LOAD_COUNT] ignitionLoadBins;;"Load", 1, 0.0, 0, 300.0, 2
|
||||
float[IGN_RPM_COUNT] ignitionRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
! ignition_table_t ignitionTable;
|
||||
! float[IGN_LOAD_COUNT] ignitionLoadBins;;"Load", 1, 0.0, 0, 300.0, 2
|
||||
! float[IGN_RPM_COUNT] ignitionRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
ve_table_t veTable;
|
||||
float[FUEL_LOAD_COUNT] veLoadBins;;"%", 1, 0.0, 0, 300.0, 2
|
||||
float[FUEL_RPM_COUNT] veRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
! ve_table_t veTable;
|
||||
! float[FUEL_LOAD_COUNT] veLoadBins;;"%", 1, 0.0, 0, 300.0, 2
|
||||
! float[FUEL_RPM_COUNT] veRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
afr_table_t afrTable;
|
||||
float[FUEL_LOAD_COUNT] afrLoadBins;;"%", 1, 0.0, 0, 300.0, 2
|
||||
float[FUEL_RPM_COUNT] afrRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
! afr_table_t afrTable;
|
||||
! float[FUEL_LOAD_COUNT] afrLoadBins;;"%", 1, 0.0, 0, 300.0, 2
|
||||
! float[FUEL_RPM_COUNT] afrRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
fuel_table_t injectionPhase;
|
||||
float[FUEL_LOAD_COUNT] injPhaseLoadBins;;"Load", 1, 0.0, 0, 300.0, 2
|
||||
float[FUEL_RPM_COUNT] injPhaseRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
! fuel_table_t injectionPhase;
|
||||
! float[FUEL_LOAD_COUNT] injPhaseLoadBins;;"Load", 1, 0.0, 0, 300.0, 2
|
||||
! float[FUEL_RPM_COUNT] injPhaseRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
! ve_table_t ve2Table;
|
||||
! float[FUEL_LOAD_COUNT] ve2LoadBins;;"%", 1, 0.0, 0, 300.0, 2
|
||||
|
|
|
@ -12,14 +12,14 @@ enable2ndByteCanID = false
|
|||
messageEnvelopeFormat = msEnvelope_1.0
|
||||
|
||||
endianness = little
|
||||
nPages = 2
|
||||
nPages = 7
|
||||
|
||||
pageIdentifier = "\x00\x00", "\x01\x00"
|
||||
pageReadCommand = "R\x00\x00%2o%2c", "R\x01\x00%2o%2c"
|
||||
burnCommand = "B\x00\x00", "B\x01\x00"
|
||||
pageActivate = "P\x00\x00", "P\x01\x00"
|
||||
pageValueWrite = "W\x00\x00%2o%v", "W\x01\x00%2o%v"
|
||||
pageChunkWrite = "C\x00\x00%2o%2c%v", "C\x01\x00%2o%2c%v"
|
||||
pageIdentifier = "\x00\x00", "\x01\x00", "\x02\x00", "\x03\x00", "\x04\x00", "\x05\x00", "\x06\x00"
|
||||
pageReadCommand = "R\x00\x00%2o%2c", "R\x01\x00%2o%2c", "R\x02\x00%2o%2c", "R\x03\x00%2o%2c", "R\x04\x00%2o%2c", "R\x05\x00%2o%2c", "R\x06\x00%2o%2c"
|
||||
burnCommand = "B\x00\x00", "B\x01\x00", "B\x02\x00", "B\x03\x00", "B\x04\x00", "B\x05\x00", "B\x06\x00"
|
||||
pageActivate = "P\x00\x00", "P\x01\x00", "P\x02\x00", "P\x03\x00", "P\x04\x00", "P\x05\x00", "P\x06\x00"
|
||||
pageValueWrite = "W\x00\x00%2o%v", "W\x01\x00%2o%v", "W\x02\x00%2o%v", "W\x03\x00%2o%v", "W\x04\x00%2o%v", "W\x05\x00%2o%v", "W\x06\x00%2o%v"
|
||||
pageChunkWrite = "C\x00\x00%2o%2c%v", "C\x01\x00%2o%2c%v", "C\x02\x00%2o%2c%v", "C\x03\x00%2o%2c%v", "C\x04\x00%2o%2c%v", "C\x05\x00%2o%2c%v", "C\x06\x00%2o%2c%v"
|
||||
|
||||
;communication settings
|
||||
;e.g. put writeblocks off and add an interwrite delay
|
||||
|
@ -35,11 +35,13 @@ enable2ndByteCanID = false
|
|||
; name = array, type, offset, shape, units, scale, translate, lo, hi, digits
|
||||
; name = scalar, type, offset, units, scale, translate, lo, hi, digits
|
||||
|
||||
pageSize = 8248, 1152, 1152, 1152, 1152, 1152, 1152
|
||||
|
||||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated by ConfigDefinition.jar on Fri Feb 27 21:32:10 EST 2015
|
||||
; this section was generated by ConfigDefinition.jar on Fri Feb 27 21:57:36 EST 2015
|
||||
|
||||
pageSize = 14008
|
||||
page = 1
|
||||
engineType = bits, S32, 0, [0:2], "AUDI_AAN", "DODGE_NEON_1995", "FORD_ASPIRE_1996", "FORD_FIESTA", "NISSAN_PRIMERA", "HONDA_ACCORD", "FORD_INLINE_6_1995", "GY6_139QMB"
|
||||
;skipping headerMagicValue offset 4
|
||||
|
@ -468,22 +470,7 @@ page = 1
|
|||
timingAdditive = array, U08, 6000, [200],"char", 1, 0, 0.0, 3.0, 2
|
||||
mafDecoding = array, F32, 6200, [256], "kg/hour", 1, 0, -500.0, 4000.0, 2
|
||||
mafDecodingBins = array, F32, 7224, [256], "V", 1, 0, -5.0, 150.0, 2
|
||||
fuelTable = array, F32, 8248, [16x16],"ms", 1, 0, 0.0, 300.0, 2
|
||||
fuelLoadBins = array, F32, 9272, [16], "V", 1, 0, 0.0, 300.0, 2
|
||||
fuelRpmBins = array, F32, 9336, [16], "RPM", 1, 0, 0.0, 25500.0, 2
|
||||
ignitionTable = array, F32, 9400, [16x16],"deg", 1, 0, -360, 360, 2
|
||||
ignitionLoadBins = array, F32, 10424, [16], "Load", 1, 0.0, 0, 300.0, 2
|
||||
ignitionRpmBins = array, F32, 10488, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
veTable = array, F32, 10552, [16x16],"%", 100, 0, 0, 100.0, 2
|
||||
veLoadBins = array, F32, 11576, [16], "%", 1, 0.0, 0, 300.0, 2
|
||||
veRpmBins = array, F32, 11640, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
afrTable = array, F32, 11704, [16x16],"deg", 1, 0, 0, 25.0, 2
|
||||
afrLoadBins = array, F32, 12728, [16], "%", 1, 0.0, 0, 300.0, 2
|
||||
afrRpmBins = array, F32, 12792, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
injectionPhase = array, F32, 12856, [16x16],"ms", 1, 0, 0.0, 300.0, 2
|
||||
injPhaseLoadBins = array, F32, 13880, [16], "Load", 1, 0.0, 0, 300.0, 2
|
||||
injPhaseRpmBins = array, F32, 13944, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
; total TS size = 14008
|
||||
; total TS size = 8248
|
||||
; CONFIG_DEFINITION_END
|
||||
|
||||
page = 2
|
||||
|
@ -491,6 +478,30 @@ page = 2
|
|||
ve2LoadBins = array, F32, 1024, [16], "%", 1, 0.0, 0, 300.0, 2
|
||||
ve2RpmBins = array, F32, 1088, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
page = 3
|
||||
fuelTable = array, F32, 0, [16x16],"ms", 1, 0, 0.0, 300.0, 2
|
||||
fuelLoadBins = array, F32, 1024, [16], "V", 1, 0, 0.0, 300.0, 2
|
||||
fuelRpmBins = array, F32, 1088, [16], "RPM", 1, 0, 0.0, 25500.0, 2
|
||||
|
||||
page = 4
|
||||
ignitionTable = array, F32, 0, [16x16],"deg", 1, 0, -360, 360, 2
|
||||
ignitionLoadBins = array, F32, 1024, [16], "Load", 1, 0.0, 0, 300.0, 2
|
||||
ignitionRpmBins = array, F32, 1088, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
page = 5
|
||||
veTable = array, F32, 0, [16x16],"%", 100, 0, 0, 100.0, 2
|
||||
veLoadBins = array, F32, 1024, [16], "%", 1, 0.0, 0, 300.0, 2
|
||||
veRpmBins = array, F32, 1088, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
page = 6
|
||||
afrTable = array, F32, 0, [16x16],"deg", 1, 0, 0, 25.0, 2
|
||||
afrLoadBins = array, F32, 1024, [16], "%", 1, 0.0, 0, 300.0, 2
|
||||
afrRpmBins = array, F32, 1088, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
page = 7
|
||||
injectionPhase = array, F32, 0, [16x16],"ms", 1, 0, 0.0, 300.0, 2
|
||||
injPhaseLoadBins = array, F32, 1024, [16], "Load", 1, 0.0, 0, 300.0, 2
|
||||
injPhaseRpmBins = array, F32, 1088, [16], "RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
|
||||
[Tuning]
|
||||
|
|
|
@ -30,7 +30,7 @@ void testMafFuelMath(void) {
|
|||
|
||||
engineConfiguration->injector.flow = 200;
|
||||
|
||||
setMap(engineConfiguration->afrTable, 13);
|
||||
setMap(config->afrTable, 13);
|
||||
|
||||
float fuelMs = getRealMafFuel(300, 6000 PASS_ENGINE_PARAMETER);
|
||||
assertEquals(26.7099, fuelMs);
|
||||
|
@ -45,13 +45,13 @@ void testFuelMap(void) {
|
|||
printf("Filling fuel map\r\n");
|
||||
for (int k = 0; k < FUEL_LOAD_COUNT; k++) {
|
||||
for (int r = 0; r < FUEL_RPM_COUNT; r++) {
|
||||
eth.engine.engineConfiguration->fuelTable[k][r] = k * 200 + r;
|
||||
eth.engine.config->fuelTable[k][r] = k * 200 + r;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < FUEL_LOAD_COUNT; i++)
|
||||
eth.engine.engineConfiguration->fuelLoadBins[i] = i;
|
||||
eth.engine.config->fuelLoadBins[i] = i;
|
||||
for (int i = 0; i < FUEL_RPM_COUNT; i++)
|
||||
eth.engine.engineConfiguration->fuelRpmBins[i] = i;
|
||||
eth.engine.config->fuelRpmBins[i] = i;
|
||||
|
||||
assertEqualsM("base fuel table", 1005, getBaseTableFuel(eth.engine.engineConfiguration, 5, 5));
|
||||
|
||||
|
|
|
@ -190,8 +190,8 @@ void testFordAspire(void) {
|
|||
persistent_config_s *config = eth.config;
|
||||
assertEquals(4, eth.engine.triggerShape.getTriggerShapeSynchPointIndex());
|
||||
|
||||
assertEquals(800, engineConfiguration->fuelRpmBins[0]);
|
||||
assertEquals(7000, engineConfiguration->fuelRpmBins[15]);
|
||||
assertEquals(800, config->fuelRpmBins[0]);
|
||||
assertEquals(7000, config->fuelRpmBins[15]);
|
||||
|
||||
engineConfiguration->crankingChargeAngle = 65;
|
||||
engineConfiguration->crankingTimingAngle = 31;
|
||||
|
|
Loading…
Reference in New Issue