auto-sync
This commit is contained in:
parent
a3ed8d4d8f
commit
b178ee956f
|
@ -26,6 +26,9 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->trigger.type = TT_60_2_VW;
|
||||
// engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;
|
||||
|
||||
// with this complex trigger we do not need this by default
|
||||
boardConfiguration->sensorChartMode = SC_OFF;
|
||||
|
||||
|
||||
engineConfiguration->injectionMode = IM_BATCH;
|
||||
// enable two_wire_batch_injection
|
||||
|
|
|
@ -100,7 +100,7 @@ void AccelEnrichmemnt::reset() {
|
|||
void AccelEnrichmemnt::onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S) {
|
||||
if (!cisnan(this->currentValue)) {
|
||||
delta = currentValue - this->currentValue;
|
||||
FuelSchedule *fs = &engine->engineConfiguration2->injectionEvents;
|
||||
FuelSchedule *fs = engine->engineConfiguration2->injectionEvents;
|
||||
cb.add(delta * fs->eventsCount);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "advance_map.h"
|
||||
#include "speed_density.h"
|
||||
#include "advance_map.h"
|
||||
#include "efilib2.h"
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
#include "injector_central.h"
|
||||
|
@ -86,6 +87,7 @@ void Engine::addConfigurationListener(configuration_callback_t callback) {
|
|||
}
|
||||
|
||||
Engine::Engine(persistent_config_s *config) {
|
||||
init(config);
|
||||
/**
|
||||
* it's important for fixAngle() that engineCycle field never has zero
|
||||
*/
|
||||
|
@ -98,12 +100,9 @@ Engine::Engine(persistent_config_s *config) {
|
|||
isTestMode = false;
|
||||
isSpinning = false;
|
||||
adcToVoltageInputDividerCoefficient = NAN;
|
||||
this->config = config;
|
||||
engineConfiguration = &config->engineConfiguration;
|
||||
engineConfiguration2 = NULL;
|
||||
engineState.iat = engineState.clt = NAN;
|
||||
memset(&ignitionPin, 0, sizeof(ignitionPin));
|
||||
memset(config, 0, sizeof(persistent_config_s));
|
||||
|
||||
knockNow = false;
|
||||
knockEver = false;
|
||||
|
@ -181,6 +180,9 @@ void Engine::preCalculate() {
|
|||
}
|
||||
|
||||
void Engine::init(persistent_config_s *config) {
|
||||
this->config = config;
|
||||
engineConfiguration = &config->engineConfiguration;
|
||||
memset(config, 0, sizeof(persistent_config_s));
|
||||
}
|
||||
|
||||
static bool stopPin(NamedOutputPin *output) {
|
||||
|
@ -304,6 +306,21 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
|||
}
|
||||
|
||||
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
ENGINE(m.beforeInjectonSch) = GET_TIMESTAMP();
|
||||
|
||||
injection_mode_e mode = isCrankingR(rpm) ? CONFIG(crankingInjectionMode) : CONFIG(injectionMode);
|
||||
|
||||
ENGINE(engineConfiguration2)->processing->addFuelEvents(
|
||||
mode PASS_ENGINE_PARAMETER);
|
||||
ENGINE(m.injectonSchTime) = GET_TIMESTAMP() - ENGINE(m.beforeInjectonSch);
|
||||
|
||||
/**
|
||||
* Swap pointers. This way we are always reading from one instance while adjusting scheduling of another instance.
|
||||
*/
|
||||
FuelSchedule * t = ENGINE(engineConfiguration2)->injectionEvents;
|
||||
ENGINE(engineConfiguration2)->injectionEvents = ENGINE(engineConfiguration2)->processing;
|
||||
ENGINE(engineConfiguration2)->processing = t;
|
||||
}
|
||||
|
||||
StartupFuelPumping::StartupFuelPumping() {
|
||||
|
|
|
@ -70,7 +70,10 @@ public:
|
|||
engine_configuration2_s();
|
||||
|
||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
FuelSchedule injectionEvents;
|
||||
FuelSchedule injectionEvents0;
|
||||
FuelSchedule injectionEvents1;
|
||||
FuelSchedule *injectionEvents;
|
||||
FuelSchedule *processing;
|
||||
#endif
|
||||
|
||||
OutputSignal fuelActuators[MAX_INJECTION_OUTPUT_COUNT];
|
||||
|
|
|
@ -864,6 +864,8 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
}
|
||||
|
||||
engine_configuration2_s::engine_configuration2_s() {
|
||||
injectionEvents = &injectionEvents0;
|
||||
processing = &injectionEvents0;
|
||||
}
|
||||
|
||||
void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_S) {
|
||||
|
|
|
@ -407,7 +407,7 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_F) {
|
|||
TRIGGER_SHAPE(triggerIndexByAngle[angle]) = triggerShapeIndex;
|
||||
}
|
||||
|
||||
engineConfiguration2->injectionEvents.addFuelEvents(
|
||||
engineConfiguration2->injectionEvents->addFuelEvents(
|
||||
engineConfiguration->crankingInjectionMode PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ static ALWAYS_INLINE void handleFuel(bool limitedFuel, uint32_t eventIndex, int
|
|||
* Ignition events are defined by addFuelEvents() according to selected
|
||||
* fueling strategy
|
||||
*/
|
||||
FuelSchedule *fs = &ENGINE(engineConfiguration2)->injectionEvents;
|
||||
FuelSchedule *fs = ENGINE(engineConfiguration2)->injectionEvents;
|
||||
|
||||
InjectionEventList *source = &fs->injectionEvents;
|
||||
|
||||
|
@ -360,13 +360,6 @@ static ALWAYS_INLINE void scheduleIgnitionAndFuelEvents(int rpm, int revolutionI
|
|||
initializeIgnitionActions(ENGINE(engineState.timingAdvance), ENGINE(engineState.dwellAngle), list PASS_ENGINE_PARAMETER);
|
||||
engine->m.ignitionSchTime = GET_TIMESTAMP() - engine->m.beforeIgnitionSch;
|
||||
|
||||
ENGINE(m.beforeInjectonSch) = GET_TIMESTAMP();
|
||||
|
||||
injection_mode_e mode = isCrankingR(rpm) ? CONFIG(crankingInjectionMode) : CONFIG(injectionMode);
|
||||
|
||||
ENGINE(engineConfiguration2)->injectionEvents.addFuelEvents(
|
||||
mode PASS_ENGINE_PARAMETER);
|
||||
ENGINE(m.injectonSchTime) = GET_TIMESTAMP() - ENGINE(m.beforeInjectonSch);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -186,7 +186,7 @@ void runRusEfi(void) {
|
|||
*/
|
||||
initializeConsole(&sharedLogger);
|
||||
|
||||
engine->init();
|
||||
engine->init(config);
|
||||
|
||||
addConsoleAction("reboot", scheduleReboot);
|
||||
|
||||
|
|
Loading…
Reference in New Issue