示例#1
0
void initInjectorCentral(void) {
	initLogging(&logger, "InjectorCentral");
	chThdCreateStatic(benchThreadStack, sizeof(benchThreadStack), NORMALPRIO, (tfunc_t) benchThread, NULL);

	for (int i = 0; i < engineConfiguration->cylindersCount; i++) {
		is_injector_enabled[i] = true;
        }

	// todo: should we move this code closer to the injection logic?
	for (int i = 0; i < engineConfiguration->cylindersCount; i++) {
		io_pin_e pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + i);

		outputPinRegisterExt2(getPinName(pin), pin, boardConfiguration->injectionPins[i],
				&boardConfiguration->injectionPinMode);
	}

	printStatus();
	addConsoleActionII("injector", setInjectorEnabled);

	addConsoleActionII("fuelpumpbench", &fuelpumpbench);

	addConsoleActionSSS("fuelbench", &fuelbench);
	addConsoleActionSSS("sparkbench", &sparkbench);

	addConsoleActionSSSSS("fuelbench2", &fuelbench2);
	addConsoleActionSSSSS("sparkbench2", &sparkbench2);
}
示例#2
0
void Node::debugPrintPins() const
{
	std::cerr << "Node: " << getNodeName() << std::endl;
	int numPins = static_cast<int>(m_pinTypeIds.size());
	for (PinIndex pinIndex = 0; pinIndex < numPins; ++pinIndex)
	{
		std::cerr << "pin#" << pinIndex << " \"" << getPinName(pinIndex) << "\": " << debugGetPinType(pinIndex) << std::endl;
	}
	std::cerr << std::endl;
}
示例#3
0
void turnPinLow(io_pin_e pin) {
	// turn off the output
	// todo: this XOR should go inside the setOutputPinValue method
	setOutputPinValue(pin, false);

#if EFI_DEFAILED_LOGGING
	systime_t after = hTimeNow();
	debugInt(&signal->logging, "a_time", after - signal->hi_time);
	scheduleLogging(&signal->logging);
#endif /* EFI_DEFAILED_LOGGING */

#if EFI_WAVE_CHART
	addWaveChartEvent(getPinName(pin), WC_DOWN, "");
#endif /* EFI_WAVE_ANALYZER */
}
示例#4
0
void turnPinHigh(io_pin_e pin) {
#if EFI_DEFAILED_LOGGING
//	signal->hi_time = hTimeNow();
#endif /* EFI_DEFAILED_LOGGING */
	// turn the output level ACTIVE
	// todo: this XOR should go inside the setOutputPinValue method
	setOutputPinValue(pin, TRUE);
	// sleep for the needed duration

#if EFI_PROD_CODE || EFI_SIMULATOR
	if (pin == SPARKOUT_1_OUTPUT || pin == SPARKOUT_3_OUTPUT) {
//		time_t now = hTimeNow();
//		float an = getCrankshaftAngle(now);
//		scheduleMsg(&logger, "spark up%d %d", pin, now);
//		scheduleMsg(&logger, "spark angle %d %f", (int)an, an);
	}
#endif

#if EFI_WAVE_CHART
	addWaveChartEvent(getPinName(pin), WC_UP, "");
#endif /* EFI_WAVE_ANALYZER */
}