auto-sync

This commit is contained in:
rusEfi 2015-01-01 16:03:28 -06:00
parent 5663ab3491
commit 5332d54ac8
10 changed files with 15 additions and 26 deletions

View File

@ -41,9 +41,6 @@ class engine_configuration2_s {
public:
engine_configuration2_s();
// todo: this should go, too
engine_configuration_s *engineConfiguration;
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
FuelSchedule crankingInjectionEvents;
FuelSchedule injectionEvents;
@ -51,19 +48,11 @@ public:
float fsioLastValue[LE_COMMAND_COUNT];
float sparkAtable[DWELL_CURVE_SIZE];
float sparkBtable[DWELL_CURVE_SIZE];
Table2D sparkTable;
void precalc();
/**
* We are alternating two event lists in order to avoid a potential issue around revolution boundary
* when an event is scheduled within the next revolution.
*/
IgnitionEventList ignitionEvents[2];
uint64_t stopEngineRequestTimeNt;
};

View File

@ -45,6 +45,12 @@ Engine::Engine() {
lastTriggerEventTimeNt = 0;
isCylinderCleanupMode = false;
engineCycleEventCount = 0;
stopEngineRequestTimeNt = 0;
}
void Engine::precalc(engine_configuration_s *engineConfiguration) {
sparkTable.init(DWELL_CURVE_SIZE, sparkAtable, sparkBtable);
sparkTable.preCalc(engineConfiguration->sparkDwellBins, engineConfiguration->sparkDwell);
}
void Engine::init() {

View File

@ -33,6 +33,8 @@ public:
engine_configuration_s *engineConfiguration;
engine_configuration2_s *engineConfiguration2;
uint64_t stopEngineRequestTimeNt;
Thermistor iat;
Thermistor clt;
@ -83,7 +85,11 @@ public:
uint32_t before5;
uint32_t before6;
float sparkAtable[DWELL_CURVE_SIZE];
float sparkBtable[DWELL_CURVE_SIZE];
Table2D sparkTable;
void precalc(engine_configuration_s *engineConfiguration);
void updateSlowSensors();
void watchdog();

View File

@ -673,13 +673,6 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType, Engine *e
}
engine_configuration2_s::engine_configuration2_s() {
engineConfiguration = NULL;
stopEngineRequestTimeNt = 0;
}
void engine_configuration2_s::precalc() {
sparkTable.init(DWELL_CURVE_SIZE, sparkAtable, sparkBtable);
sparkTable.preCalc(engineConfiguration->sparkDwellBins, engineConfiguration->sparkDwell);
}
void applyNonPersistentConfiguration(Logging * logger, Engine *engine) {

View File

@ -747,7 +747,7 @@ static void disableIgnition(void) {
}
static void stopEngine(Engine *engine) {
engine->engineConfiguration2->stopEngineRequestTimeNt = getTimeNowNt();
engine->stopEngineRequestTimeNt = getTimeNowNt();
}
#if EFI_WAVE_CHART

View File

@ -67,7 +67,7 @@ RpmCalculator::RpmCalculator() {
bool RpmCalculator::isRunning(DECLARE_ENGINE_PARAMETER_F) {
engine_configuration2_s *engineConfiguration2 = engine->engineConfiguration2;
uint64_t nowNt = getTimeNowNt();
if (engineConfiguration2->stopEngineRequestTimeNt != 0) {
if (engine->stopEngineRequestTimeNt != 0) {
if (nowNt - lastRpmEventTimeNt < 3 * US2NT(US_PER_SECOND_LL)) {
return false;
}

View File

@ -144,7 +144,6 @@ void runRusEfi(void) {
// that's dirty, this assignment should be nicer or in a better spot
engine->engineConfiguration = engineConfiguration;
engine->engineConfiguration2 = engineConfiguration2;
engineConfiguration2->engineConfiguration = engineConfiguration;
initErrorHandling();

View File

@ -16,7 +16,6 @@ extern int timeNow;
EngineTestHelper::EngineTestHelper(engine_type_e engineType) {
ec = &persistentConfig.engineConfiguration;
engine.engineConfiguration = &persistentConfig.engineConfiguration;
ec2.engineConfiguration = &persistentConfig.engineConfiguration;
engine_configuration_s *engineConfiguration = ec;

View File

@ -1,6 +1,5 @@
TEST_SRC_C = boards.c
TEST_SRC_CPP = test_util.cpp \
boards.cpp \
test_data_structures/test_event_registry.cpp \
test_basic_math/test_find_index.cpp \
test_basic_math/test_interpolation_3d.cpp \
@ -14,6 +13,4 @@ TEST_SRC_CPP = test_util.cpp \
test_signal_executor.cpp \
test_sensors.cpp \
test_accel_enrichment.cpp