Requesting LUA Torque intervention #3638
This commit is contained in:
parent
eee7a3a406
commit
f4ab23eb2b
|
@ -322,6 +322,8 @@ expected<percent_t> EtbController::getSetpointEtb() const {
|
|||
// Linearly taper throttle to closed from the limit across the range
|
||||
targetPosition = interpolateClamped(etbRpmLimit, targetPosition, fullyLimitedRpm, 0, rpm);
|
||||
}
|
||||
// todo: this does not mix well with etbRevLimitStart interpolation does it?
|
||||
targetPosition += engine->engineState.luaAdjustments.etbTargetPositionAdd;
|
||||
|
||||
#if EFI_TUNER_STUDIO
|
||||
if (m_function == ETB_Throttle1) {
|
||||
|
|
|
@ -18,6 +18,7 @@ struct LuaAdjustments {
|
|||
float ignitionTimingMult = 1;
|
||||
float fuelAdd = 0;
|
||||
float fuelMult = 1;
|
||||
float etbTargetPositionAdd = 0;
|
||||
};
|
||||
|
||||
class EngineState : public engine_state2_s {
|
||||
|
|
|
@ -537,6 +537,10 @@ void configureRusefiLuaHooks(lua_State* l) {
|
|||
engine->engineState.luaAdjustments.fuelMult = luaL_checknumber(l, 1);
|
||||
return 0;
|
||||
});
|
||||
lua_register(l, "setEtbAdd", [](lua_State* l) {
|
||||
engine->engineState.luaAdjustments.etbTargetPositionAdd = luaL_checknumber(l, 1);
|
||||
return 0;
|
||||
});
|
||||
|
||||
lua_register(l, "getTimeSinceTriggerEventMs", [](lua_State* l) {
|
||||
int result = engine->triggerCentral.m_lastEventTimer.getElapsedUs() / 1000;
|
||||
|
|
Loading…
Reference in New Issue