auto-sync
This commit is contained in:
parent
6271401982
commit
7b1cc151b8
|
@ -63,6 +63,7 @@ void setDodgeNeon1995EngineConfiguration(engine_configuration_s *engineConfigura
|
|||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(engineConfiguration, 3);
|
||||
setWholeTimingTable(engineConfiguration, 12);
|
||||
|
||||
// set_cranking_injection_mode 0
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
|
|
@ -72,8 +72,6 @@ static volatile bool fullLog = true;
|
|||
int warningEnabled = TRUE;
|
||||
//int warningEnabled = FALSE;
|
||||
|
||||
extern engine_configuration_s * engineConfiguration;
|
||||
extern engine_configuration2_s * engineConfiguration2;
|
||||
extern board_configuration_s *boardConfiguration;
|
||||
#define FULL_LOGGING_KEY "fl"
|
||||
|
||||
|
@ -126,6 +124,8 @@ void printSensors(Engine *engine) {
|
|||
reportSensorI("rpm", getRpmE(engine));
|
||||
reportSensorF("maf", getMaf(), 2);
|
||||
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
if (engineConfiguration->hasMapSensor) {
|
||||
reportSensorF(getCaption(LP_MAP), getMap(), 2);
|
||||
reportSensorF("map_r", getRawMap(), 2);
|
||||
|
@ -159,6 +159,8 @@ void printState(Engine *engine, int currentCkpEventCounter) {
|
|||
#if EFI_SHAFT_POSITION_INPUT
|
||||
printSensors(engine);
|
||||
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
int rpm = getRpmE(engine);
|
||||
debugInt(&logger, "ckp_c", currentCkpEventCounter);
|
||||
|
||||
|
@ -209,7 +211,9 @@ static void printOutPin(const char *pinName, brain_pin_e hwPin) {
|
|||
}
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
static void printInfo(systime_t nowSeconds) {
|
||||
static void printInfo(Engine *engine, systime_t nowSeconds) {
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
/**
|
||||
* we report the version every 4 seconds - this way the console does not need to
|
||||
* request it and we will display it pretty soon
|
||||
|
@ -274,7 +278,7 @@ void updateDevConsoleState(Engine *engine) {
|
|||
}
|
||||
|
||||
systime_t nowSeconds = getTimeNowSeconds();
|
||||
printInfo(nowSeconds);
|
||||
printInfo(engine, nowSeconds);
|
||||
|
||||
int currentCkpEventCounter = getCrankEventCounter();
|
||||
if (prevCkpEventCounter == currentCkpEventCounter && timeOfPreviousReport == nowSeconds) {
|
||||
|
@ -303,9 +307,14 @@ 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);
|
||||
|
||||
scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->algorithm), boolToString(getOutputPinValue(FUEL_PUMP_RELAY)));
|
||||
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),
|
||||
boolToString(getOutputPinValue(FUEL_PUMP_RELAY)));
|
||||
|
||||
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(engine));
|
||||
|
||||
|
@ -385,7 +394,6 @@ static void errBlinkingThread(void *arg) {
|
|||
}
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
|
||||
static void lcdThread(Engine *engine) {
|
||||
chRegSetThreadName("lcd");
|
||||
while (true) {
|
||||
|
@ -407,6 +415,8 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC
|
|||
int rpm = 0;
|
||||
#endif
|
||||
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
float tps = getTPS(engineConfiguration);
|
||||
float coolant = getCoolantTemperature(engine);
|
||||
float intake = getIntakeAirTemperature(engine);
|
||||
|
@ -475,8 +485,8 @@ void initStatusLoop(Engine *engine) {
|
|||
#if EFI_PROD_CODE
|
||||
initLogging(&logger2, "main event handler");
|
||||
|
||||
addConsoleActionFFP("fuelinfo2", (VoidFloatFloatVoidPtr)showFuelInfo2, engine);
|
||||
addConsoleActionP("fuelinfo", (VoidPtr)showFuelInfo, engine);
|
||||
addConsoleActionFFP("fuelinfo2", (VoidFloatFloatVoidPtr) showFuelInfo2, engine);
|
||||
addConsoleActionP("fuelinfo", (VoidPtr) showFuelInfo, engine);
|
||||
|
||||
addConsoleAction("status", printStatus);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
|
|
@ -89,6 +89,15 @@ void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value) {
|
|||
}
|
||||
}
|
||||
|
||||
void setWholeTimingTable(engine_configuration_s *engineConfiguration, float value) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Global default engine configuration
|
||||
* This method sets the default global engine configuration. These values are later overridden by engine-specific defaults
|
||||
|
@ -100,7 +109,7 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
|
|||
|
||||
setDetaultVETable(engineConfiguration);
|
||||
|
||||
engineConfiguration->injectorLag = 0.0;
|
||||
engineConfiguration->injectorLag = 1.0;
|
||||
|
||||
for (int i = 0; i < IAT_CURVE_SIZE; i++) {
|
||||
engineConfiguration->iatFuelCorrBins[i] = -40 + i * 10;
|
||||
|
|
|
@ -504,6 +504,7 @@ extern "C" {
|
|||
|
||||
void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
|
||||
void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value);
|
||||
void setWholeTimingTable(engine_configuration_s *engineConfiguration, float value);
|
||||
void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs);
|
||||
void printFloatArray(const char *prefix, float array[], int size);
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ static Map3D1616 fuelMap;
|
|||
float getInjectorLag(engine_configuration_s *engineConfiguration, float vBatt) {
|
||||
if (cisnan(vBatt)) {
|
||||
warning(OBD_System_Voltage_Malfunction, "vBatt=%f", vBatt);
|
||||
return 0;
|
||||
return engineConfiguration->injectorLag;
|
||||
}
|
||||
float vBattCorrection = interpolate2d(vBatt, engineConfiguration->battInjectorLagCorrBins,
|
||||
engineConfiguration->battInjectorLagCorr, VBAT_INJECTOR_CURVE_SIZE);
|
||||
|
|
|
@ -42,7 +42,7 @@ void testFuelMap(void) {
|
|||
initThermistors(ð.engine);
|
||||
|
||||
printf("*** getInjectorLag\r\n");
|
||||
assertEquals(0, getInjectorLag(eth.engine.engineConfiguration, 12));
|
||||
assertEquals(1.0, getInjectorLag(eth.engine.engineConfiguration, 12));
|
||||
|
||||
eth.engine.engineConfiguration->injectorLag = 0.5;
|
||||
|
||||
|
|
|
@ -405,6 +405,8 @@ static void testRpmCalculator(void) {
|
|||
|
||||
// this is a very dirty and sad hack. todo: eliminate
|
||||
engine.engineConfiguration = eth.engine.engineConfiguration;
|
||||
engine.engineConfiguration->injectorLag = 0.0;
|
||||
|
||||
|
||||
configuration_s configuration = { ec, ec2 };
|
||||
timeNow = 0;
|
||||
|
|
Loading…
Reference in New Issue