This commit is contained in:
rusefillc 2022-07-14 12:36:55 -04:00
parent 7cada13589
commit cad14d6541
5 changed files with 12 additions and 8 deletions

View File

@ -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);
}; };

View File

@ -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

View File

@ -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;

View File

@ -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() {

View File

@ -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