Ejemplo n.º 1
0
static void setToothedWheel(int total, int skipped) {
	scheduleMsg(&logger, "toothed: total=%d/skipped=%d", total, skipped);
	setToothedWheelConfiguration(&engine->triggerShape, total, skipped, engineConfiguration->operationMode);
//	initializeTriggerShape(&logger, engineConfiguration, engineConfiguration2);
	incrementGlobalConfigurationVersion();
	doPrintConfiguration(engine);
}
Ejemplo n.º 2
0
/**
 * External logger is needed because at this point our logger is not yet initialized
 */
void initializeTriggerShape(Logging *logger, engine_configuration_s *engineConfiguration,
		engine_configuration2_s *engineConfiguration2) {
#if EFI_PROD_CODE
	scheduleMsg(logger, "initializeTriggerShape()");
#endif
	trigger_config_s *triggerConfig = &engineConfiguration->triggerConfig;
	trigger_shape_s *triggerShape = &engineConfiguration2->triggerShape;

	setTriggerSynchronizationGap(triggerShape, 2);
	triggerShape->useRiseEdge = TRUE;

	switch (triggerConfig->triggerType) {

	case TT_TOOTHED_WHEEL:
		// todo: move to into configuration definition		engineConfiguration2->triggerShape.needSecondTriggerInput = false;

		engineConfiguration2->triggerShape.isSynchronizationNeeded =
				engineConfiguration->triggerConfig.customIsSynchronizationNeeded;

		initializeSkippedToothTriggerShapeExt(triggerShape, triggerConfig->customTotalToothCount,
				triggerConfig->customSkippedToothCount, getOperationMode(engineConfiguration));
		return;

	case TT_MAZDA_MIATA_NA:
		initializeMazdaMiataNaShape(triggerShape);
		return;

	case TT_MAZDA_MIATA_NB:
		initializeMazdaMiataNbShape(triggerShape);
		return;

	case TT_DODGE_NEON:
		configureNeonTriggerShape(triggerShape);
		return;

	case TT_FORD_ASPIRE:
		configureFordAspireTriggerShape(triggerConfig, triggerShape);
		return;

	case TT_GM_7X:
		configureGmTriggerShape(triggerConfig, triggerShape);
		return;

	case TT_FORD_ESCORT_GT:
		configureMazdaProtegeLx(triggerShape);
		return;

	case TT_MINI_COOPER_R50:
		configureMiniCooperTriggerShape(triggerShape);
		return;

	case TT_TOOTHED_WHEEL_60_2:
		setToothedWheelConfiguration(triggerShape, 60, 2, engineConfiguration);
		setTriggerSynchronizationGap(triggerShape, 2.5);
		return;

	case TT_TOOTHED_WHEEL_36_1:
		setToothedWheelConfiguration(triggerShape, 36, 1, engineConfiguration);
		return;

	case TT_HONDA_ACCORD_CD_TWO_WIRES:
		configureHondaAccordCD(triggerShape, false);
		return;

	case TT_HONDA_ACCORD_CD:
		configureHondaAccordCD(triggerShape, true);
		return;

	case TT_HONDA_ACCORD_CD_DIP:
		configureHondaAccordCDDip(triggerShape);
		return;

	case TT_MITSU:
		initializeMitsubishi4g18(triggerShape);
		return;

	default:
		firmwareError("initializeTriggerShape() not implemented: %d", triggerConfig->triggerType);
		;
	}
	if (engineConfiguration2->triggerShape.shaftPositionEventCount != engineConfiguration2->triggerShape.getSize())
		firmwareError("trigger size or shaftPositionEventCount?");
}
Ejemplo n.º 3
0
void initialize2jzGE3_34(TriggerShape *s) {
	setToothedWheelConfiguration(s, 36, 2, FOUR_STROKE_CRANK_SENSOR);

//	s->initialize(FOUR_STROKE_CAM_SENSOR, true);
//
//	float camD = 720 / 6; // 120
//
//	float crankAngle = 20; // skipping two teeth
//
//	for (int i = 0; i < 10; i++) {
//		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
//		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
//		crankAngle += 10;
//	} // 2 + 10
//
//	float camAngle = 0;
//	camAngle += camD;
//	s->addEvent2(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 120
//
//	for (int i = 0; i < 12; i++) {
//		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
//		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
//		crankAngle += 10;
//	} // 2 + 22
//
//
//	camAngle += camD;
//	s->addEvent2(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 240
//
//	for (int i = 0; i < 12; i++) {
//		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
//		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
//		crankAngle += 10;
//	} // 2 + 34
//
//	camAngle += camD;
//	s->addEvent2(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 360
//
//	crankAngle += 20; // skipping two teeth one more time
//	for (int i = 0; i < 10; i++) {
//		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
//		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
//		crankAngle += 10;
//	} // 2 + 10
//
//	camAngle += camD;
//	s->addEvent2(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 480
//
//	for (int i = 0; i < 12; i++) {
//		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
//		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
//		crankAngle += 10;
//	} // 2 + 22
//
//	camAngle += camD;
//	s->addEvent2(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 600
//
//
//	for (int i = 0; i < 12; i++) {
//		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
//		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
//		crankAngle += 10;
//	} // 2 + 32
//	camAngle += camD;
//	s->addEvent2(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 720
//
//	s->isSynchronizationNeeded = false;

}