auto-sync

This commit is contained in:
rusEfi 2016-06-26 20:03:27 -04:00
parent c2efaa40db
commit fed54e5ebe
4 changed files with 13 additions and 2 deletions

View File

@ -315,6 +315,7 @@ void Engine::watchdog() {
void Engine::prepareFuelSchedule(DECLARE_ENGINE_PARAMETER_F) {
int rpm = rpmCalculator.rpmValue;
efiAssertVoid(ENGINE(engineConfiguration2)->injectionEvents != ENGINE(engineConfiguration2)->processing, "fuel pointers");
ENGINE(m.beforeInjectonSch) = GET_TIMESTAMP();

View File

@ -70,9 +70,18 @@ public:
engine_configuration2_s();
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
/**
* Lock-free multithreading: two instances, while one is being modified another one is used read-only
*/
FuelSchedule injectionEvents0;
FuelSchedule injectionEvents1;
/**
* this points at an instance we use to run the engine
*/
FuelSchedule *injectionEvents;
/**
* this variable is pointing at the instance which is being modified
*/
FuelSchedule *processing;
#endif

View File

@ -915,8 +915,8 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
}
engine_configuration2_s::engine_configuration2_s() {
injectionEvents = &injectionEvents0;
processing = &injectionEvents0;
injectionEvents = &injectionEvents0;
processing = &injectionEvents1;
}
void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_S) {

View File

@ -156,6 +156,7 @@ void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMET
}
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F) {
userPool.reset();
for (int i = 0; i < LE_COMMAND_COUNT; i++) {
brain_pin_e brainPin = boardConfiguration->fsioPins[i];