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