mirror of https://github.com/rusefi/rusefi.git
#4308 progress
This commit is contained in:
parent
7cada13589
commit
cad14d6541
|
@ -18,9 +18,5 @@ size_t getMultiSparkCount(int rpm);
|
||||||
|
|
||||||
class IgnitionState : public ignition_state_s {
|
class IgnitionState : public ignition_state_s {
|
||||||
public:
|
public:
|
||||||
IgnitionState() {
|
|
||||||
// todo https://github.com/rusefi/rusefi/issues/4308
|
|
||||||
luaTimingMult = 1;
|
|
||||||
}
|
|
||||||
floatms_t getSparkDwell(int rpm);
|
floatms_t getSparkDwell(int rpm);
|
||||||
};
|
};
|
||||||
|
|
|
@ -353,8 +353,18 @@ void Engine::reset() {
|
||||||
*/
|
*/
|
||||||
engineCycle = getEngineCycle(FOUR_STROKE_CRANK_SENSOR);
|
engineCycle = getEngineCycle(FOUR_STROKE_CRANK_SENSOR);
|
||||||
memset(&ignitionPin, 0, sizeof(ignitionPin));
|
memset(&ignitionPin, 0, sizeof(ignitionPin));
|
||||||
|
resetLua();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Engine::resetLua() {
|
||||||
|
// todo: https://github.com/rusefi/rusefi/issues/4308
|
||||||
|
engineState.lua = {};
|
||||||
|
engineState.lua.fuelMult = 1;
|
||||||
|
boostController.luaTargetAdd = 0;
|
||||||
|
boostController.luaTargetMult = 1;
|
||||||
|
ignitionState.luaTimingAdd = 0;
|
||||||
|
ignitionState.luaTimingMult = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Here we have a bunch of stuff which should invoked after configuration change
|
* Here we have a bunch of stuff which should invoked after configuration change
|
||||||
|
|
|
@ -219,11 +219,11 @@ public:
|
||||||
#endif // EFI_BOOST_CONTROL
|
#endif // EFI_BOOST_CONTROL
|
||||||
|
|
||||||
IgnitionState ignitionState;
|
IgnitionState ignitionState;
|
||||||
|
void resetLua();
|
||||||
|
|
||||||
FanControl1 fan1;
|
FanControl1 fan1;
|
||||||
FanControl2 fan2;
|
FanControl2 fan2;
|
||||||
|
|
||||||
|
|
||||||
efitick_t mostRecentSparkEvent;
|
efitick_t mostRecentSparkEvent;
|
||||||
efitick_t mostRecentTimeBetweenSparkEvents;
|
efitick_t mostRecentTimeBetweenSparkEvents;
|
||||||
efitick_t mostRecentIgnitionEvent;
|
efitick_t mostRecentIgnitionEvent;
|
||||||
|
|
|
@ -79,8 +79,6 @@ float FuelConsumptionState::getConsumptionGramPerSecond() const {
|
||||||
|
|
||||||
EngineState::EngineState() {
|
EngineState::EngineState() {
|
||||||
timeSinceLastTChargeK = getTimeNowNt();
|
timeSinceLastTChargeK = getTimeNowNt();
|
||||||
// todo: https://github.com/rusefi/rusefi/issues/4308
|
|
||||||
lua.fuelMult = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EngineState::updateSlowSensors() {
|
void EngineState::updateSlowSensors() {
|
||||||
|
|
|
@ -319,7 +319,7 @@ void LuaThread::ThreadTask() {
|
||||||
bool wasOk = runOneLua(myAlloc, config->luaScript);
|
bool wasOk = runOneLua(myAlloc, config->luaScript);
|
||||||
|
|
||||||
// Reset any lua adjustments the script made
|
// Reset any lua adjustments the script made
|
||||||
// todo https://github.com/rusefi/rusefi/issues/4308 engine->engineState.luaAdjustments = {};
|
engine->resetLua();
|
||||||
|
|
||||||
if (!wasOk) {
|
if (!wasOk) {
|
||||||
// Something went wrong executing the script, spin
|
// Something went wrong executing the script, spin
|
||||||
|
|
Loading…
Reference in New Issue