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