auto-sync

This commit is contained in:
rusEfi 2015-05-25 13:04:53 -04:00
parent 3b7aca3308
commit ad19e5c08c
2 changed files with 14 additions and 3 deletions

View File

@ -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},
};
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();
if (cisnan(engineLoad)) {
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.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 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)) {
angle = engineConfiguration->crankingTimingAngle;
} else {
angle = getBaseAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
angle = getRunningAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
}
angle -= engineConfiguration->ignitionBaseAngle;
fixAngle(angle);

View File

@ -291,5 +291,5 @@ int getRusEfiVersion(void) {
return 123; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] * 0 != 0)
return 3211; // this is here to make the compiler happy about the unused array
return 20150524;
return 20150525;
}