Esempio n. 1
0
void initTriggerEmulator(Engine *engine) {

	engine_configuration_s *engineConfiguration = engine->engineConfiguration;
	board_configuration_s *boardConfiguration = &engineConfiguration->bc;

#if EFI_EMULATE_POSITION_SENSORS || defined(__DOXYGEN__)
	print("Emulating %s\r\n", getConfigurationName(engineConfiguration->engineType));

	triggerSignal.outputPins[0] = TRIGGER_EMULATOR_PRIMARY;
	triggerSignal.outputPins[1] = TRIGGER_EMULATOR_SECONDARY;
	triggerSignal.outputPins[2] = TRIGGER_EMULATOR_3RD;

#if EFI_PROD_CODE
	// todo: refactor, make this a loop
	outputPinRegisterExt2("distributor ch1", triggerSignal.outputPins[0], boardConfiguration->triggerSimulatorPins[0],
			&boardConfiguration->triggerSimulatorPinModes[0]);

	outputPinRegisterExt2("distributor ch2", triggerSignal.outputPins[1], boardConfiguration->triggerSimulatorPins[1],
			&boardConfiguration->triggerSimulatorPinModes[1]);

	outputPinRegisterExt2("distributor ch3", triggerSignal.outputPins[2], boardConfiguration->triggerSimulatorPins[2],
			&boardConfiguration->triggerSimulatorPinModes[2]);
#endif /* EFI_PROD_CODE */

	initTriggerEmulatorLogic(engine);
#else
	print("No position sensor(s) emulation\r\n");
#endif /* EFI_EMULATE_POSITION_SENSORS */
}
Esempio n. 2
0
void initTriggerEmulator(void) {
#if EFI_EMULATE_POSITION_SENSORS
	print("Emulating %s\r\n", getConfigurationName(engineConfiguration));

	configuration.outputPins[0] = TRIGGER_EMILATOR_PRIMARY;
	configuration.outputPins[1] = TRIGGER_EMILATOR_SECONDARY;

	outputPinRegisterExt2("distributor ch1", configuration.outputPins[0], boardConfiguration->triggerSimulatorPins[0],
			&boardConfiguration->triggerSimulatorPinModes[0]);

	outputPinRegisterExt2("distributor ch2", configuration.outputPins[1], boardConfiguration->triggerSimulatorPins[1],
			&boardConfiguration->triggerSimulatorPinModes[1]);

	initTriggerEmulatorLogic(applyPinState);
#else
	print("No position sensor(s) emulation\r\n");
#endif /* EFI_EMULATE_POSITION_SENSORS */
}