auto-sync
This commit is contained in:
parent
3b7aca3308
commit
ad19e5c08c
|
@ -52,7 +52,14 @@ static const ignition_table_t defaultIatTiming = {
|
||||||
{-4.4, -4.9, -5.9, -5.9, -5.9, -5.9, -4.9, -4.9, -4.9, -4.9, -4.9, -3.9, -3.9, -3.9, -3.9, -3.9},
|
{-4.4, -4.9, -5.9, -5.9, -5.9, -5.9, -4.9, -4.9, -4.9, -4.9, -4.9, -3.9, -3.9, -3.9, -3.9, -3.9},
|
||||||
};
|
};
|
||||||
|
|
||||||
float getBaseAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
bool_t isStep1Condition(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
return boardConfiguration->enabledStep1Limiter && rpm >= engineConfiguration->step1rpm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ignition timing angle advance before TDC
|
||||||
|
*/
|
||||||
|
static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
||||||
engine->m.beforeAdvance = GET_TIMESTAMP();
|
engine->m.beforeAdvance = GET_TIMESTAMP();
|
||||||
if (cisnan(engineLoad)) {
|
if (cisnan(engineLoad)) {
|
||||||
warning(OBD_PCM_Processor_Fault, "NaN engine load");
|
warning(OBD_PCM_Processor_Fault, "NaN engine load");
|
||||||
|
@ -63,6 +70,10 @@ float getBaseAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
||||||
engine->m.beforeZeroTest = GET_TIMESTAMP();
|
engine->m.beforeZeroTest = GET_TIMESTAMP();
|
||||||
engine->m.zeroTestTime = GET_TIMESTAMP() - engine->m.beforeZeroTest;
|
engine->m.zeroTestTime = GET_TIMESTAMP() - engine->m.beforeZeroTest;
|
||||||
|
|
||||||
|
if (isStep1Condition(rpm PASS_ENGINE_PARAMETER)) {
|
||||||
|
return engineConfiguration->step1timing;
|
||||||
|
}
|
||||||
|
|
||||||
float iatCorrection = iatAdvanceCorrectionMap.getValue(engine->engineState.clt, (float) rpm);
|
float iatCorrection = iatAdvanceCorrectionMap.getValue(engine->engineState.clt, (float) rpm);
|
||||||
|
|
||||||
float result = advanceMap.getValue(engineLoad, (float) rpm) + iatCorrection;
|
float result = advanceMap.getValue(engineLoad, (float) rpm) + iatCorrection;
|
||||||
|
@ -75,7 +86,7 @@ angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
||||||
if (isCrankingR(rpm)) {
|
if (isCrankingR(rpm)) {
|
||||||
angle = engineConfiguration->crankingTimingAngle;
|
angle = engineConfiguration->crankingTimingAngle;
|
||||||
} else {
|
} else {
|
||||||
angle = getBaseAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
|
angle = getRunningAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
|
||||||
}
|
}
|
||||||
angle -= engineConfiguration->ignitionBaseAngle;
|
angle -= engineConfiguration->ignitionBaseAngle;
|
||||||
fixAngle(angle);
|
fixAngle(angle);
|
||||||
|
|
|
@ -291,5 +291,5 @@ int getRusEfiVersion(void) {
|
||||||
return 123; // this is here to make the compiler happy about the unused array
|
return 123; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||||
return 3211; // this is here to make the compiler happy about the unused array
|
return 3211; // this is here to make the compiler happy about the unused array
|
||||||
return 20150524;
|
return 20150525;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue