auto-sync

This commit is contained in:
rusEfi 2014-10-01 20:03:03 -05:00
parent 95b780d6cf
commit 4d2cdf384a
9 changed files with 33 additions and 35 deletions

View File

@ -66,7 +66,6 @@ void configureMiniCooperTriggerShape(trigger_shape_s *s) {
s->addEvent(720.0, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = s->getSize();
/**
* With just one tooth on camshaft synchronization is not needed
*/

View File

@ -35,8 +35,6 @@ void configureNeon2003TriggerShape(trigger_shape_s *s) {
s->addEvent(base + 674, T_PRIMARY, TV_HIGH);
s->addEvent(base + 710, T_PRIMARY, TV_LOW);
s->assignSize();
}
void configureNeon1995TriggerShape(trigger_shape_s *s) {
@ -95,7 +93,5 @@ void configureNeon1995TriggerShape(trigger_shape_s *s) {
s->addEvent(base + 497, T_SECONDARY, TV_LOW);
s->addEvent(base + 560, T_PRIMARY, TV_HIGH); // width =
s->shaftPositionEventCount = 4 + 8 + 8 + 8 + 8;
}

View File

@ -185,8 +185,7 @@ void initializeSkippedToothTriggerShapeExt(trigger_shape_s *s, int totalTeethCou
s->skippedToothCount = skippedCount;
initializeSkippedToothTriggerShape(s, totalTeethCount, skippedCount, operationMode);
s->shaftPositionEventCount = ((totalTeethCount - skippedCount) * 2);
s->wave.checkSwitchTimes(s->getSize());
s->assignSize();
}
/**
@ -213,71 +212,73 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin
initializeSkippedToothTriggerShapeExt(triggerShape, triggerConfig->customTotalToothCount,
triggerConfig->customSkippedToothCount, getOperationMode(engineConfiguration));
return;
break;
case TT_MAZDA_MIATA_NA:
initializeMazdaMiataNaShape(triggerShape);
return;
break;
case TT_MAZDA_MIATA_NB:
initializeMazdaMiataNbShape(triggerShape);
return;
break;
case TT_DODGE_NEON_1995:
configureNeon1995TriggerShape(triggerShape);
return;
break;
case TT_DODGE_NEON_2003:
configureNeon2003TriggerShape(triggerShape);
return;
break;
case TT_FORD_ASPIRE:
configureFordAspireTriggerShape(triggerShape);
return;
break;
case TT_GM_7X:
configureGmTriggerShape(triggerShape);
return;
break;
case TT_FORD_ESCORT_GT:
configureMazdaProtegeLx(triggerShape);
return;
break;
case TT_MINI_COOPER_R50:
configureMiniCooperTriggerShape(triggerShape);
return;
break;
case TT_TOOTHED_WHEEL_60_2:
setToothedWheelConfiguration(triggerShape, 60, 2, engineConfiguration);
setTriggerSynchronizationGap(triggerShape, 2.5);
return;
break;
case TT_TOOTHED_WHEEL_36_1:
setToothedWheelConfiguration(triggerShape, 36, 1, engineConfiguration);
return;
break;
case TT_HONDA_ACCORD_CD_TWO_WIRES:
configureHondaAccordCD(triggerShape, false);
return;
break;
case TT_HONDA_ACCORD_CD:
configureHondaAccordCD(triggerShape, true);
return;
break;
case TT_HONDA_ACCORD_CD_DIP:
configureHondaAccordCDDip(triggerShape);
return;
break;
case TT_MITSU:
initializeMitsubishi4g18(triggerShape);
return;
break;
default:
firmwareError("initializeTriggerShape() not implemented: %d", triggerConfig->triggerType);
;
return;
}
if (engineConfiguration2->triggerShape.shaftPositionEventCount != engineConfiguration2->triggerShape.getSize())
firmwareError("trigger size or shaftPositionEventCount?");
trigger_shape_s *s = &engineConfiguration2->triggerShape;
s->assignSize();
s->wave.checkSwitchTimes(s->getSize());
}
TriggerStimulatorHelper::TriggerStimulatorHelper() {

View File

@ -13,8 +13,6 @@ void configureGmTriggerShape(trigger_shape_s *s) {
// all angles are x2 here - so, 5 degree width is 10
float w = 10;
s->shaftPositionEventCount = 14;
s->addEvent(120 - w, T_PRIMARY, TV_HIGH);
s->addEvent(120.0, T_PRIMARY, TV_LOW);
@ -36,5 +34,6 @@ void configureGmTriggerShape(trigger_shape_s *s) {
s->addEvent(720 - w, T_PRIMARY, TV_HIGH);
s->addEvent(720.0, T_PRIMARY, TV_LOW);
s->assignSize();
}

View File

@ -43,8 +43,7 @@ void initializeMazdaMiataNaShape(trigger_shape_s *s) {
s->addEvent(656.5125, T_SECONDARY, TV_LOW);
s->addEvent(720.0f, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = s->getSize();
s->assignSize();
}
void initializeMazdaMiataNbShape(trigger_shape_s *s) {
@ -84,7 +83,7 @@ void initializeMazdaMiataNbShape(trigger_shape_s *s) {
s->addEvent(720.0f, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = 6 + 16;
s->assignSize();
}
void configureMazdaProtegeLx(trigger_shape_s *s) {
@ -128,7 +127,6 @@ void configureMazdaProtegeLx(trigger_shape_s *s) {
s->addEvent(a, T_PRIMARY, TV_LOW);
// s->shaftPositionEventCount = 2 + 8;
s->shaftPositionEventCount = s->getSize();
s->assignSize();
s->isSynchronizationNeeded = false;
}

View File

@ -27,7 +27,7 @@ void configureFordAspireTriggerShape(trigger_shape_s * s) {
s->addEvent(x + 540, T_SECONDARY, TV_LOW);
s->addEvent(720, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = s->getSize();
s->assignSize();
}
void initializeMitsubishi4g18(trigger_shape_s *s) {

View File

@ -375,7 +375,7 @@ void configureHondaAccordCDDip(trigger_shape_s *s) {
s->isSynchronizationNeeded = false;
s->shaftPositionEventCount = s->getSize();
s->assignSize();
}
void configureHondaAccordCD(trigger_shape_s *s, bool with3rdSignal) {
@ -424,5 +424,5 @@ void configureHondaAccordCD(trigger_shape_s *s, bool with3rdSignal) {
s->addEvent(i * 180.0f, T_PRIMARY, TV_LOW);
}
s->shaftPositionEventCount = s->getSize();
s->assignSize();
}

View File

@ -131,7 +131,7 @@ int main(void) {
testFLStack();
// resizeMap();
printf("Success 20130926\r\n");
printf("Success 20131001\r\n");
return EXIT_SUCCESS;
}

View File

@ -30,6 +30,8 @@ Engine engine;
extern int timeNow;
extern bool printGapRatio;
extern "C" {
void sendOutConfirmation(char *value, int i);
}
@ -476,6 +478,9 @@ void testTriggerDecoder(void) {
testTriggerDecoder2("miata 1994", MIATA_1994, 11, 0.2917, 0.3716);
testTriggerDecoder2("citroen", CITROEN_TU3JP, 0, 0.4833, 0.0);
printGapRatio = true;
testTriggerDecoder2("neon NGC", DODGE_NEON_2003, 6, 0.2139, 0.0);
testMazda323();
testRpmCalculator();