random progress
This commit is contained in:
parent
1bf3ef1cc2
commit
70fd233740
|
@ -182,10 +182,10 @@ bool EnginePins::stopPins() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnginePins::unregisterPins() {
|
void EnginePins::unregisterPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
stopInjectionPins();
|
stopInjectionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
stopIgnitionPins();
|
stopIgnitionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
stopAuxValves();
|
stopAuxValves(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
#if EFI_ELECTRONIC_THROTTLE_BODY
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
unregisterEtbPins();
|
unregisterEtbPins();
|
||||||
|
@ -219,9 +219,9 @@ void EnginePins::debug() {
|
||||||
|
|
||||||
void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
startInjectionPins();
|
startInjectionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
startIgnitionPins();
|
startIgnitionPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
startAuxValves();
|
startAuxValves(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
#endif /* EFI_ENGINE_CONTROL */
|
#endif /* EFI_ENGINE_CONTROL */
|
||||||
|
|
||||||
RegisteredOutputPin * pin = registeredOutputHead;
|
RegisteredOutputPin * pin = registeredOutputHead;
|
||||||
|
@ -239,7 +239,7 @@ void EnginePins::reset() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnginePins::stopIgnitionPins(void) {
|
void EnginePins::stopIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
for (int i = 0; i < MAX_CYLINDER_COUNT; i++) {
|
for (int i = 0; i < MAX_CYLINDER_COUNT; i++) {
|
||||||
unregisterOutputIfPinOrModeChanged(enginePins.coils[i], ignitionPins[i], ignitionPinMode);
|
unregisterOutputIfPinOrModeChanged(enginePins.coils[i], ignitionPins[i], ignitionPinMode);
|
||||||
|
@ -247,7 +247,7 @@ void EnginePins::stopIgnitionPins(void) {
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnginePins::stopInjectionPins(void) {
|
void EnginePins::stopInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
for (int i = 0; i < MAX_CYLINDER_COUNT; i++) {
|
for (int i = 0; i < MAX_CYLINDER_COUNT; i++) {
|
||||||
unregisterOutputIfPinOrModeChanged(enginePins.injectors[i], injectionPins[i], injectionPinMode);
|
unregisterOutputIfPinOrModeChanged(enginePins.injectors[i], injectionPins[i], injectionPinMode);
|
||||||
|
@ -255,7 +255,7 @@ void EnginePins::stopInjectionPins(void) {
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnginePins::stopAuxValves(void) {
|
void EnginePins::stopAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
for (int i = 0; i < AUX_DIGITAL_VALVE_COUNT; i++) {
|
for (int i = 0; i < AUX_DIGITAL_VALVE_COUNT; i++) {
|
||||||
NamedOutputPin *output = &enginePins.auxValve[i];
|
NamedOutputPin *output = &enginePins.auxValve[i];
|
||||||
|
@ -267,7 +267,7 @@ void EnginePins::stopAuxValves(void) {
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnginePins::startAuxValves(void) {
|
void EnginePins::startAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
for (int i = 0; i < AUX_DIGITAL_VALVE_COUNT; i++) {
|
for (int i = 0; i < AUX_DIGITAL_VALVE_COUNT; i++) {
|
||||||
NamedOutputPin *output = &enginePins.auxValve[i];
|
NamedOutputPin *output = &enginePins.auxValve[i];
|
||||||
|
@ -279,7 +279,7 @@ void EnginePins::startAuxValves(void) {
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnginePins::startIgnitionPins(void) {
|
void EnginePins::startIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||||
NamedOutputPin *trailingOutput = &enginePins.trailingCoils[i];
|
NamedOutputPin *trailingOutput = &enginePins.trailingCoils[i];
|
||||||
|
@ -295,7 +295,7 @@ void EnginePins::startIgnitionPins(void) {
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnginePins::startInjectionPins(void) {
|
void EnginePins::startInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
// todo: should we move this code closer to the injection logic?
|
// todo: should we move this code closer to the injection logic?
|
||||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||||
|
|
|
@ -164,7 +164,7 @@ public:
|
||||||
void reset();
|
void reset();
|
||||||
static void debug();
|
static void debug();
|
||||||
bool stopPins();
|
bool stopPins();
|
||||||
void unregisterPins();
|
void unregisterPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
RegisteredOutputPin mainRelay;
|
RegisteredOutputPin mainRelay;
|
||||||
/**
|
/**
|
||||||
* High Pressure Fuel Pump valve control
|
* High Pressure Fuel Pump valve control
|
||||||
|
@ -214,13 +214,13 @@ public:
|
||||||
OutputPin tcuSolenoids[TCU_SOLENOID_COUNT];
|
OutputPin tcuSolenoids[TCU_SOLENOID_COUNT];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void startInjectionPins();
|
void startInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void startIgnitionPins();
|
void startIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void startAuxValves();
|
void startAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
void stopInjectionPins();
|
void stopInjectionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void stopIgnitionPins();
|
void stopIgnitionPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void stopAuxValves();
|
void stopAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
|
@ -56,6 +56,10 @@ int EngineTestHelper::getWarningCounter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callback_t configurationCallback, const std::unordered_map<SensorType, float>& sensorValues) {
|
EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callback_t configurationCallback, const std::unordered_map<SensorType, float>& sensorValues) {
|
||||||
|
Engine *engine = &this->engine;
|
||||||
|
engine->setConfig(engine, &persistentConfig.engineConfiguration, &persistentConfig);
|
||||||
|
EXPAND_Engine;
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::Clt, 70);
|
Sensor::setMockValue(SensorType::Clt, 70);
|
||||||
Sensor::setMockValue(SensorType::Iat, 30);
|
Sensor::setMockValue(SensorType::Iat, 30);
|
||||||
|
|
||||||
|
@ -68,11 +72,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
|
||||||
memset(&activeConfiguration, 0, sizeof(activeConfiguration));
|
memset(&activeConfiguration, 0, sizeof(activeConfiguration));
|
||||||
|
|
||||||
enginePins.reset();
|
enginePins.reset();
|
||||||
enginePins.unregisterPins();
|
enginePins.unregisterPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
Engine *engine = &this->engine;
|
|
||||||
engine->setConfig(engine, &persistentConfig.engineConfiguration, &persistentConfig);
|
|
||||||
EXPAND_Engine;
|
|
||||||
|
|
||||||
INJECT_ENGINE_REFERENCE(&waveChart);
|
INJECT_ENGINE_REFERENCE(&waveChart);
|
||||||
waveChart.init();
|
waveChart.init();
|
||||||
|
@ -113,6 +113,8 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
|
||||||
}
|
}
|
||||||
|
|
||||||
EngineTestHelper::~EngineTestHelper() {
|
EngineTestHelper::~EngineTestHelper() {
|
||||||
|
Engine *engine = &this->engine;
|
||||||
|
EXPAND_Engine;
|
||||||
// Write history to file
|
// Write history to file
|
||||||
std::stringstream filePath;
|
std::stringstream filePath;
|
||||||
filePath << "unittest_" << ::testing::UnitTest::GetInstance()->current_test_info()->name() << ".logicdata";
|
filePath << "unittest_" << ::testing::UnitTest::GetInstance()->current_test_info()->name() << ".logicdata";
|
||||||
|
@ -120,7 +122,7 @@ EngineTestHelper::~EngineTestHelper() {
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
enginePins.reset();
|
enginePins.reset();
|
||||||
enginePins.unregisterPins();
|
enginePins.unregisterPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
Sensor::resetRegistry();
|
Sensor::resetRegistry();
|
||||||
memset(mockPinStates, 0, sizeof(mockPinStates));
|
memset(mockPinStates, 0, sizeof(mockPinStates));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue