adding simplicity
This commit is contained in:
parent
82f3972417
commit
1576a9f731
|
@ -94,8 +94,7 @@
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
// this method is used by real firmware and simulator and unit test
|
||||
void mostCommonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
static void mostCommonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if !EFI_UNIT_TEST
|
||||
initSensors();
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
@ -298,8 +297,6 @@ static void resetAccel(void) {
|
|||
}
|
||||
}
|
||||
|
||||
static int previousSecond;
|
||||
|
||||
#if ENABLE_PERF_TRACE
|
||||
|
||||
void irqEnterHook(void) {
|
||||
|
@ -659,13 +656,19 @@ static void getKnockInfo(void) {
|
|||
|
||||
engine->printKnockState();
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
// this method is used by real firmware and simulator but not unit tests
|
||||
// this method is used by real firmware and simulator and unit test
|
||||
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_SIMULATOR
|
||||
printf("commonInitEngineController\n");
|
||||
#endif
|
||||
|
||||
#if !EFI_UNIT_TEST
|
||||
initConfigActions();
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
|
||||
#if EFI_ENABLE_MOCK_ADC
|
||||
initMockVoltage();
|
||||
#endif /* EFI_ENABLE_MOCK_ADC */
|
||||
|
@ -674,10 +677,6 @@ void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S
|
|||
initSensorChart();
|
||||
#endif /* EFI_SENSOR_CHART */
|
||||
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
// todo: this is a mess, remove code duplication with simulator
|
||||
initSettings();
|
||||
#endif
|
||||
|
||||
#if EFI_TUNER_STUDIO
|
||||
if (engineConfiguration->isTunerStudioEnabled) {
|
||||
|
@ -685,12 +684,19 @@ void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S
|
|||
}
|
||||
#endif /* EFI_TUNER_STUDIO */
|
||||
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
initSettings();
|
||||
|
||||
if (hasFirmwareError()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
mostCommonInitEngineController(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
#if !EFI_UNIT_TEST
|
||||
|
||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_SIMULATOR
|
||||
printf("initEngineContoller\n");
|
||||
|
|
|
@ -9,14 +9,11 @@
|
|||
#pragma once
|
||||
|
||||
#include "global.h"
|
||||
#include "engine_configuration.h"
|
||||
#include "engine.h"
|
||||
|
||||
char * getPinNameByAdcChannel(const char *msg, adc_channel_e hwChannel, char *buffer);
|
||||
void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
void mostCommonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
#if EFI_ENABLE_MOCK_ADC
|
||||
void setMockVoltage(int hwChannel, float voltage DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
|
|
|
@ -57,7 +57,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
|
|||
|
||||
initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
mostCommonInitEngineController(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
commonInitEngineController(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
resetConfigurationExt(NULL, boardCallback, engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
|
Loading…
Reference in New Issue