inject (#2938)
This commit is contained in:
parent
ff31301284
commit
1bba234920
|
@ -182,10 +182,10 @@ bool EnginePins::stopPins() {
|
|||
return result;
|
||||
}
|
||||
|
||||
void EnginePins::unregisterPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
stopInjectionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
stopIgnitionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
stopAuxValves(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
void EnginePins::unregisterPins() {
|
||||
stopInjectionPins();
|
||||
stopIgnitionPins();
|
||||
stopAuxValves();
|
||||
|
||||
#if EFI_ELECTRONIC_THROTTLE_BODY
|
||||
unregisterEtbPins();
|
||||
|
@ -214,11 +214,11 @@ void EnginePins::debug() {
|
|||
}
|
||||
}
|
||||
|
||||
void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
void EnginePins::startPins() {
|
||||
#if EFI_ENGINE_CONTROL
|
||||
startInjectionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
startIgnitionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
startAuxValves(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
startInjectionPins();
|
||||
startIgnitionPins();
|
||||
startAuxValves();
|
||||
#endif /* EFI_ENGINE_CONTROL */
|
||||
|
||||
RegisteredOutputPin * pin = registeredOutputHead;
|
||||
|
@ -236,20 +236,20 @@ void EnginePins::reset() {
|
|||
}
|
||||
}
|
||||
|
||||
void EnginePins::stopIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
void EnginePins::stopIgnitionPins() {
|
||||
for (int i = 0; i < MAX_CYLINDER_COUNT; i++) {
|
||||
unregisterOutputIfPinOrModeChanged(enginePins.coils[i], ignitionPins[i], ignitionPinMode);
|
||||
unregisterOutputIfPinOrModeChanged(enginePins.trailingCoils[i], trailingCoilPins[i], ignitionPinMode);
|
||||
}
|
||||
}
|
||||
|
||||
void EnginePins::stopInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
void EnginePins::stopInjectionPins() {
|
||||
for (int i = 0; i < MAX_CYLINDER_COUNT; i++) {
|
||||
unregisterOutputIfPinOrModeChanged(enginePins.injectors[i], injectionPins[i], injectionPinMode);
|
||||
}
|
||||
}
|
||||
|
||||
void EnginePins::stopAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
void EnginePins::stopAuxValves() {
|
||||
for (int i = 0; i < AUX_DIGITAL_VALVE_COUNT; i++) {
|
||||
NamedOutputPin *output = &enginePins.auxValve[i];
|
||||
// todo: do we need auxValveMode and reuse code?
|
||||
|
@ -259,7 +259,7 @@ void EnginePins::stopAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
}
|
||||
}
|
||||
|
||||
void EnginePins::startAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
void EnginePins::startAuxValves() {
|
||||
#if EFI_PROD_CODE
|
||||
for (int i = 0; i < AUX_DIGITAL_VALVE_COUNT; i++) {
|
||||
NamedOutputPin *output = &enginePins.auxValve[i];
|
||||
|
@ -271,7 +271,7 @@ void EnginePins::startAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
void EnginePins::startIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
void EnginePins::startIgnitionPins() {
|
||||
#if EFI_PROD_CODE
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
NamedOutputPin *trailingOutput = &enginePins.trailingCoils[i];
|
||||
|
@ -287,7 +287,7 @@ void EnginePins::startIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
void EnginePins::startInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
void EnginePins::startInjectionPins() {
|
||||
#if EFI_PROD_CODE
|
||||
// todo: should we move this code closer to the injection logic?
|
||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||
|
|
|
@ -159,12 +159,14 @@ public:
|
|||
|
||||
class EnginePins {
|
||||
public:
|
||||
DECLARE_ENGINE_PTR;
|
||||
|
||||
EnginePins();
|
||||
void startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void startPins();
|
||||
void reset();
|
||||
static void debug();
|
||||
bool stopPins();
|
||||
void unregisterPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void unregisterPins();
|
||||
RegisteredOutputPin mainRelay;
|
||||
/**
|
||||
* High Pressure Fuel Pump valve control
|
||||
|
@ -214,13 +216,13 @@ public:
|
|||
OutputPin tcuSolenoids[TCU_SOLENOID_COUNT];
|
||||
|
||||
private:
|
||||
void startInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void startIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void startAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void startInjectionPins();
|
||||
void startIgnitionPins();
|
||||
void startAuxValves();
|
||||
|
||||
void stopInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void stopIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void stopAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void stopInjectionPins();
|
||||
void stopIgnitionPins();
|
||||
void stopAuxValves();
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
|
|
@ -540,7 +540,7 @@ void initHardware() {
|
|||
initOutputPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if EFI_ENGINE_CONTROL
|
||||
enginePins.startPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
enginePins.startPins();
|
||||
#endif /* EFI_ENGINE_CONTROL */
|
||||
|
||||
#if EFI_MC33816
|
||||
|
|
|
@ -71,8 +71,9 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
|
|||
|
||||
memset(&activeConfiguration, 0, sizeof(activeConfiguration));
|
||||
|
||||
INJECT_ENGINE_REFERENCE(&enginePins);
|
||||
enginePins.reset();
|
||||
enginePins.unregisterPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
enginePins.unregisterPins();
|
||||
|
||||
INJECT_ENGINE_REFERENCE(&waveChart);
|
||||
waveChart.init();
|
||||
|
@ -94,7 +95,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
|
|||
|
||||
resetConfigurationExt(configurationCallback, engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
enginePins.startPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
enginePins.startPins();
|
||||
|
||||
commonInitEngineController(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
@ -122,7 +123,7 @@ EngineTestHelper::~EngineTestHelper() {
|
|||
|
||||
// Cleanup
|
||||
enginePins.reset();
|
||||
enginePins.unregisterPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
enginePins.unregisterPins();
|
||||
Sensor::resetRegistry();
|
||||
memset(mockPinStates, 0, sizeof(mockPinStates));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue