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->addEvent(720.0, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = s->getSize();
/** /**
* With just one tooth on camshaft synchronization is not needed * 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 + 674, T_PRIMARY, TV_HIGH);
s->addEvent(base + 710, T_PRIMARY, TV_LOW); s->addEvent(base + 710, T_PRIMARY, TV_LOW);
s->assignSize();
} }
void configureNeon1995TriggerShape(trigger_shape_s *s) { 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 + 497, T_SECONDARY, TV_LOW);
s->addEvent(base + 560, T_PRIMARY, TV_HIGH); // width = 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; s->skippedToothCount = skippedCount;
initializeSkippedToothTriggerShape(s, totalTeethCount, skippedCount, operationMode); initializeSkippedToothTriggerShape(s, totalTeethCount, skippedCount, operationMode);
s->shaftPositionEventCount = ((totalTeethCount - skippedCount) * 2); s->assignSize();
s->wave.checkSwitchTimes(s->getSize());
} }
/** /**
@ -213,71 +212,73 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin
initializeSkippedToothTriggerShapeExt(triggerShape, triggerConfig->customTotalToothCount, initializeSkippedToothTriggerShapeExt(triggerShape, triggerConfig->customTotalToothCount,
triggerConfig->customSkippedToothCount, getOperationMode(engineConfiguration)); triggerConfig->customSkippedToothCount, getOperationMode(engineConfiguration));
return; break;
case TT_MAZDA_MIATA_NA: case TT_MAZDA_MIATA_NA:
initializeMazdaMiataNaShape(triggerShape); initializeMazdaMiataNaShape(triggerShape);
return; break;
case TT_MAZDA_MIATA_NB: case TT_MAZDA_MIATA_NB:
initializeMazdaMiataNbShape(triggerShape); initializeMazdaMiataNbShape(triggerShape);
return; break;
case TT_DODGE_NEON_1995: case TT_DODGE_NEON_1995:
configureNeon1995TriggerShape(triggerShape); configureNeon1995TriggerShape(triggerShape);
return; break;
case TT_DODGE_NEON_2003: case TT_DODGE_NEON_2003:
configureNeon2003TriggerShape(triggerShape); configureNeon2003TriggerShape(triggerShape);
return; break;
case TT_FORD_ASPIRE: case TT_FORD_ASPIRE:
configureFordAspireTriggerShape(triggerShape); configureFordAspireTriggerShape(triggerShape);
return; break;
case TT_GM_7X: case TT_GM_7X:
configureGmTriggerShape(triggerShape); configureGmTriggerShape(triggerShape);
return; break;
case TT_FORD_ESCORT_GT: case TT_FORD_ESCORT_GT:
configureMazdaProtegeLx(triggerShape); configureMazdaProtegeLx(triggerShape);
return; break;
case TT_MINI_COOPER_R50: case TT_MINI_COOPER_R50:
configureMiniCooperTriggerShape(triggerShape); configureMiniCooperTriggerShape(triggerShape);
return; break;
case TT_TOOTHED_WHEEL_60_2: case TT_TOOTHED_WHEEL_60_2:
setToothedWheelConfiguration(triggerShape, 60, 2, engineConfiguration); setToothedWheelConfiguration(triggerShape, 60, 2, engineConfiguration);
setTriggerSynchronizationGap(triggerShape, 2.5); setTriggerSynchronizationGap(triggerShape, 2.5);
return; break;
case TT_TOOTHED_WHEEL_36_1: case TT_TOOTHED_WHEEL_36_1:
setToothedWheelConfiguration(triggerShape, 36, 1, engineConfiguration); setToothedWheelConfiguration(triggerShape, 36, 1, engineConfiguration);
return; break;
case TT_HONDA_ACCORD_CD_TWO_WIRES: case TT_HONDA_ACCORD_CD_TWO_WIRES:
configureHondaAccordCD(triggerShape, false); configureHondaAccordCD(triggerShape, false);
return; break;
case TT_HONDA_ACCORD_CD: case TT_HONDA_ACCORD_CD:
configureHondaAccordCD(triggerShape, true); configureHondaAccordCD(triggerShape, true);
return; break;
case TT_HONDA_ACCORD_CD_DIP: case TT_HONDA_ACCORD_CD_DIP:
configureHondaAccordCDDip(triggerShape); configureHondaAccordCDDip(triggerShape);
return; break;
case TT_MITSU: case TT_MITSU:
initializeMitsubishi4g18(triggerShape); initializeMitsubishi4g18(triggerShape);
return; break;
default: default:
firmwareError("initializeTriggerShape() not implemented: %d", triggerConfig->triggerType); firmwareError("initializeTriggerShape() not implemented: %d", triggerConfig->triggerType);
; ;
return;
} }
if (engineConfiguration2->triggerShape.shaftPositionEventCount != engineConfiguration2->triggerShape.getSize()) trigger_shape_s *s = &engineConfiguration2->triggerShape;
firmwareError("trigger size or shaftPositionEventCount?"); s->assignSize();
s->wave.checkSwitchTimes(s->getSize());
} }
TriggerStimulatorHelper::TriggerStimulatorHelper() { 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 // all angles are x2 here - so, 5 degree width is 10
float w = 10; float w = 10;
s->shaftPositionEventCount = 14;
s->addEvent(120 - w, T_PRIMARY, TV_HIGH); s->addEvent(120 - w, T_PRIMARY, TV_HIGH);
s->addEvent(120.0, T_PRIMARY, TV_LOW); 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 - w, T_PRIMARY, TV_HIGH);
s->addEvent(720.0, T_PRIMARY, TV_LOW); 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(656.5125, T_SECONDARY, TV_LOW);
s->addEvent(720.0f, T_PRIMARY, TV_LOW); s->addEvent(720.0f, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = s->getSize(); s->assignSize();
} }
void initializeMazdaMiataNbShape(trigger_shape_s *s) { 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->addEvent(720.0f, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = 6 + 16; s->assignSize();
} }
void configureMazdaProtegeLx(trigger_shape_s *s) { void configureMazdaProtegeLx(trigger_shape_s *s) {
@ -128,7 +127,6 @@ void configureMazdaProtegeLx(trigger_shape_s *s) {
s->addEvent(a, T_PRIMARY, TV_LOW); s->addEvent(a, T_PRIMARY, TV_LOW);
// s->shaftPositionEventCount = 2 + 8; s->assignSize();
s->shaftPositionEventCount = s->getSize();
s->isSynchronizationNeeded = false; 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(x + 540, T_SECONDARY, TV_LOW);
s->addEvent(720, T_PRIMARY, TV_LOW); s->addEvent(720, T_PRIMARY, TV_LOW);
s->shaftPositionEventCount = s->getSize(); s->assignSize();
} }
void initializeMitsubishi4g18(trigger_shape_s *s) { void initializeMitsubishi4g18(trigger_shape_s *s) {

View File

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

View File

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

View File

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