18#if EFI_PROD_CODE && HW_HELLEN
26#if EFI_CAN_SUPPORT || EFI_UNIT_TEST
33#define LUAAA_WITHOUT_CPP_STDLIB
50 auto zeroBasedCharIndex = luaL_checkinteger(l, 1);
51 if (zeroBasedCharIndex < 0 || zeroBasedCharIndex > VIN_NUMBER_SIZE) {
55 lua_pushinteger(l, value);
62 const char * msg = luaL_checkstring(l, 1);
65 efiPrintf(
"LUA: invalid pin [%s]", msg);
69 lua_pushinteger(l, physicalValue);
82 lua_pushnumber(l, result.Value);
93 auto zeroBasedSensorIndex = luaL_checkinteger(l, 1);
101 auto zeroBasedSensorIndex = luaL_checkinteger(l, 1);
110 luaL_error(l,
"Invalid sensor type: %s", name);
117 auto sensorName = luaL_checklstring(l, 1,
nullptr);
124 auto zeroBasedSensorIndex = luaL_checkinteger(l, 1);
131 auto zeroBasedSensorIndex = luaL_checkinteger(l, 1);
143 luaL_checktype(l, paramIndex, LUA_TTABLE);
145 lua_pushnumber(l, result + 1);
146 auto elementType = lua_gettable(l, paramIndex);
147 auto val = lua_tonumber(l, -1);
150 if (elementType == LUA_TNIL) {
155 if (elementType != LUA_TNUMBER) {
157 luaL_error(l,
"Unexpected data at position %d: %s", result, lua_tostring(l, -1));
164 luaL_error(l,
"Input array longer than buffer");
167 data[result - 1] = val;
173#if EFI_CAN_SUPPORT || EFI_UNIT_TEST
176 lua_Integer
channel = luaL_checkinteger(l, 1);
178 luaL_argcheck(l,
channel == 1 ||
channel == 2, 1,
"only buses 1 and 2 currently supported");
188 if (lua_gettop(l) == 2) {
190 id = luaL_checkinteger(l, 1);
195 id = luaL_checkinteger(l, 2);
196 ext = luaL_checkinteger(l, 3);
202 luaL_argcheck(l,
id <= 0x7FF, 2,
"ID specified is greater than max std ID");
204 luaL_argcheck(l,
id <= 0x1FFF'FFFF, 2,
"ID specified is greater than max ext ID");
215 luaL_checktype(l, dataIndex, LUA_TTABLE);
217 lua_pushnumber(l, dlc + 1);
218 auto elementType = lua_gettable(l, dataIndex);
219 auto val = lua_tonumber(l, -1);
222 if (elementType == LUA_TNIL) {
227 if (elementType != LUA_TNUMBER) {
229 luaL_error(l,
"Unexpected CAN data at position %d: %s", dlc, lua_tostring(l, -1));
236 luaL_error(l,
"CAN frame length cannot be longer than 8");
264 auto channel = luaL_checkinteger(l, pos);
268 if (channel < 0 || channel >= LUA_PWM_COUNT) {
269 luaL_error(l,
"setPwmDuty invalid channel %d",
channel);
276#define PWM_FREQ_PWM 1000
281 freq = clampF(1, freq, 1000);
291 efiPrintf(
"LUA PWM on %s at %f initial duty",
293 PERCENT_MULT *
duty);
298 auto freq = luaL_checknumber(l, 2);
299 auto duty = luaL_checknumber(l, 3);
301 if (duty < 0 || duty > PWM_MAX_DUTY) {
302 luaL_error(l,
"Duty parameter should be from 0 to 1 got %f",
duty);
327 auto duty = luaL_checknumber(l, 2);
335 auto freq = luaL_checknumber(l, 2);
338 freq = clampF(1, freq, 1000);
340 p.pwm.setFrequency(freq);
346 auto idx = luaL_checkinteger(l, 1);
361 lua_pushboolean(l,
state);
375 auto idx = luaL_checkinteger(l, 1);
376 if (idx < 0 || idx >= LUA_DIGITAL_INPUT_COUNT) {
390 lua_pushboolean(l,
state);
402 auto idx = luaL_checkinteger(l, 1);
403 auto val = luaL_checknumber(l, 2);
406 if (idx < 1 || idx > 7) {
411 firstDebugField[idx - 1] = val;
416#if EFI_ENGINE_CONTROL
418 if (lua_gettop(l) == 0) {
422 return static_cast<engine_load_mode_e
>(luaL_checkinteger(l, 1));
431 return luaL_error(l,
"null airmass");
435 auto result = airmass->getAirmass(rpm,
false).CylinderAirmass;
437 lua_pushnumber(l, result);
442 float airmass = luaL_checknumber(l, 1);
443 float engineLoadPercent = luaL_checknumber(l, 2);
445 airmass = clampF(0, airmass, 10);
446 engineLoadPercent = clampF(0, engineLoadPercent, 1000);
458 template<
typename TCLASS,
typename ...ARGS>
459 struct PlacementConstructorCaller<TCLASS, lua_State*, ARGS...>
464 static TCLASS * Invoke(lua_State *
state,
void * mem)
466 return InvokeImpl(
state, mem,
typename make_indices<
sizeof...(ARGS)>::type());
470 template<std::size_t ...Ns>
471 static TCLASS * InvokeImpl(lua_State *
state,
void * mem, indices<Ns...>)
474 return new(mem) TCLASS(
state, LuaStack<ARGS>::get(
state, Ns + 1)...);
480 LuaSensor() : LuaSensor(nullptr,
"Invalid") { }
486 LuaSensor(lua_State* l,
const char* name)
491 luaL_error(l,
"Tried to create a Lua sensor of type %s, but one was already registered.",
getSensorName());
494 efiPrintf(
"LUA registered sensor of type %s",
getSensorName());
499 return m_isRedundant;
507 void setRedundant(
bool value) {
508 m_isRedundant = value;
511 void set(
float value) {
519 void showInfo(
const char* sensorName)
const override {
520 const auto value =
get();
521 efiPrintf(
"Sensor \"%s\": Lua sensor: Valid: %s Converted value %.2f", sensorName,
boolToString(value.Valid), value.Value);
525 bool m_isRedundant =
false;
529 return lua_type(l, idx) == LUA_TFUNCTION;
534 return luaL_error(l,
"expected function");
536 return luaL_ref(l, LUA_REGISTRYINDEX);
546 int callback = NO_CALLBACK;
547 int argumentCount = lua_gettop(l);
549 switch (argumentCount) {
552 eid = luaL_checkinteger(l, 1);
558 eid = luaL_checkinteger(l, 1);
564 eid = luaL_checkinteger(l, 2);
571 eid = luaL_checkinteger(l, 2);
577 return luaL_error(l,
"Wrong number of arguments to canRxAdd. Got %d, expected 1, 2, or 3.", argumentCount);
591 int callback = NO_CALLBACK;
593 switch (lua_gettop(l)) {
596 eid = luaL_checkinteger(l, 1);
597 mask = luaL_checkinteger(l, 2);
603 eid = luaL_checkinteger(l, 1);
604 mask = luaL_checkinteger(l, 2);
611 eid = luaL_checkinteger(l, 2);
612 mask = luaL_checkinteger(l, 3);
619 eid = luaL_checkinteger(l, 2);
620 mask = luaL_checkinteger(l, 3);
627 return luaL_error(l,
"Wrong number of arguments to canRxAddMask. Got %d, expected 2, 3, or 4.");
646 lua_register(lState,
"random", [](lua_State* l) {
648 lua_pushnumber(l, random);
652 LuaClass<Timer> luaTimer(lState,
"Timer");
655 .fun(
"reset",
static_cast<void (Timer::*)()
>(&Timer::reset ))
656 .fun(
"getElapsedSeconds",
static_cast<float(Timer::*)()const
>(&Timer::getElapsedSeconds));
658 LuaClass<LuaSensor> luaSensor(lState,
"Sensor");
660 .ctor<lua_State*,
const char*>()
661 .fun(
"set", &LuaSensor::set)
662 .fun(
"setRedundant", &LuaSensor::setRedundant)
663 .fun(
"setTimeout", &LuaSensor::setTimeout)
664 .fun(
"invalidate", &LuaSensor::invalidate);
667#define WITH_LUA_PID TRUE
671 LuaClass<LuaBiQuad> biQuard(lState,
"Biquad");
677 LuaClass<LuaPid> luaPid(lState,
"Pid");
684 LuaClass<LuaIndustrialPid> luaIndustrialPid(lState,
"IndustrialPid");
697#if EFI_PROD_CODE && EFI_SHAFT_POSITION_INPUT
698 lua_register(lState,
"startCrankingEngine", [](lua_State* l) {
703 lua_register(lState,
"vin",
lua_vin);
711#ifndef WITH_LUA_CONSUMPTION
712#define WITH_LUA_CONSUMPTION TRUE
715#if EFI_VEHICLE_SPEED && WITH_LUA_CONSUMPTION && defined (MODULE_ODOMETER)
716 lua_register(lState,
"getConsumedGrams", [](lua_State* l) {
720 lua_register(lState,
"getConsumedGramsRemainder", [](lua_State* l) {
724 lua_register(lState,
"getConsumptionGramPerSecond", [](lua_State* l) {
728 lua_register(lState,
"resetOdometer", [](lua_State*) {
733 lua_register(lState,
"table3d", [](lua_State* l) {
734 auto humanTableIdx = luaL_checkinteger(l, 1);
735 auto x = luaL_checknumber(l, 2);
736 auto y = luaL_checknumber(l, 3);
741 lua_pushnumber(l, result);
745 lua_register(lState,
"secondsSinceTsActivity", [](lua_State* l) {
750 lua_register(lState,
"curve", [](lua_State* l) {
752 auto humanCurveIdx = luaL_checkinteger(l, 1);
753 auto x = luaL_checknumber(l, 2);
755 auto result =
getCurveValue(humanCurveIdx - HUMAN_OFFSET, x);
757 lua_pushnumber(l, result);
761#if EFI_PROD_CODE || EFI_SIMULATOR
764 lua_register(lState,
"getTsButtonCount",
766 auto humanIndex = luaL_checkinteger(l, 1);
767 if (humanIndex < 1 || humanIndex > LUA_BUTTON_COUNT) {
768 luaL_error(l,
"Invalid button index: %d", humanIndex);
776#if EFI_PROD_CODE && EFI_SENT_SUPPORT
777 lua_register(lState,
"getSentValue",
779 auto humanIndex = luaL_checkinteger(l, 1);
781 lua_pushnumber(l, value);
785 lua_register(lState,
"getSentValues",
789 auto humanIndex = luaL_checkinteger(l, 1);
791 lua_pushinteger(l, sig0);
792 lua_pushinteger(l, sig1);
797#if EFI_LAUNCH_CONTROL
798 lua_register(lState,
"setSparkSkipRatio", [](lua_State* l) {
799 auto targetSkipRatio = luaL_checknumber(l, 1);
804 lua_register(lState,
"setSparkHardSkipRatio", [](lua_State* l) {
805 auto targetSkipRatio = luaL_checknumber(l, 1);
810 lua_register(lState,
"setLaunchTrigger", [](lua_State* l) {
811 auto value = luaL_checkinteger(l, 1);
816#if EFI_ANTILAG_SYSTEM
817 lua_register(lState,
"setRollingIdleTrigger", [](lua_State* l) {
818 auto value = luaL_checkinteger(l, 1);
824#if EFI_EMULATE_POSITION_SENSORS && !EFI_UNIT_TEST
825 lua_register(lState,
"selfStimulateRPM", [](lua_State* l) {
826 auto rpm = luaL_checkinteger(l, 1);
842 lua_register(lState,
"setLuaGauge", [](lua_State* l) {
843 auto index = luaL_checkinteger(l, 1) - 1;
844 auto value = luaL_checknumber(l, 2);
845 if (index < 0 || index >= LUA_GAUGE_COUNT)
852 lua_register(lState,
"enableCanTx", [](lua_State* l) {
857 lua_register(lState,
"enableCanRxWorkaround", [](lua_State*) {
865 lua_register(lState,
"getCanRxDropped", [](lua_State* l) {
867 lua_pushinteger(l,
count);
871 lua_register(lState,
"disableExtendedCanBroadcast", [](lua_State*) {
876 lua_register(lState,
"getCanBaudRate", [](lua_State* l) {
877 auto index = luaL_checkinteger(l, 1);
887#if !defined(STM32F4) || defined(WITH_LUA_GET_GPPWM_STATE)
888 lua_register(lState,
"getGpPwm", [](lua_State* l) {
889 auto index = luaL_checkinteger(l, 1);
892 lua_pushnumber(l, result);
897#if EFI_ELECTRONIC_THROTTLE_BODY && EFI_PROD_CODE
898 lua_register(lState,
"getEtbTarget", [](lua_State* l) {
900 assertNotNull(controller, 0);
901 auto result = controller->getCurrentTarget();
902 lua_pushnumber(l, result);
905 lua_register(lState,
"restartEtb", [](lua_State*) {
914 lua_register(lState,
"crc8_j1850", [](lua_State* l) {
916 uint32_t length =
getLuaArray(l, 1, data,
sizeof(data));
917 auto trimLength = luaL_checkinteger(l, 2);
918 int crc = crc8(data, minI(length, trimLength));
920 lua_pushinteger(l, crc);
925 lua_register(lState,
"setBoostTargetAdd", [](lua_State* l) {
929 lua_register(lState,
"setBoostTargetMult", [](lua_State* l) {
933 lua_register(lState,
"setBoostDutyAdd", [](lua_State* l) {
939 lua_register(lState,
"setIdleAdd", [](lua_State* l) {
943 lua_register(lState,
"setIdleRpm", [](lua_State* l) {
944 auto rpm = luaL_checknumber(l, 1);
949 lua_register(lState,
"setTimingAdd", [](lua_State* l) {
953#ifndef DISABLE_LUA_SET_TIMING_MULT
954 lua_register(lState,
"setTimingMult", [](lua_State* l) {
959#ifndef DISABLE_LUA_SET_FUEL_ADD
960 lua_register(lState,
"setFuelAdd", [](lua_State* l) {
965 lua_register(lState,
"setFuelMult", [](lua_State* l) {
969#if EFI_ELECTRONIC_THROTTLE_BODY && EFI_PROD_CODE
970 lua_register(lState,
"setEtbAdd", [](lua_State* l) {
977 lua_register(lState,
"setEwgAdd", [](lua_State* l) {
984 lua_register(lState,
"setEtbDisabled", [](lua_State* l) {
990 lua_register(lState,
"setIgnDisabled", [](lua_State* l) {
994 lua_register(lState,
"setFuelDisabled", [](lua_State* l) {
998 lua_register(lState,
"setDfcoDisabled", [](lua_State* l) {
1004 lua_register(lState,
"setClutchUpState", [](lua_State* l) {
1008 lua_register(lState,
"setClutchDownState", [](lua_State* l) {
1012 lua_register(lState,
"setBrakePedalState", [](lua_State* l) {
1017 lua_register(lState,
"setAcRequestState", [](lua_State* l) {
1022#if !defined(STM32F4)
1023 lua_register(lState,
"getTorque", [](lua_State* l) {
1027 auto result = interpolate3d(
1032 lua_pushnumber(l, result);
1037 lua_register(lState,
"setTorqueReductionState", [](lua_State* l) {
1042 lua_register(lState,
"getCalibration", [](lua_State* l) {
1043 auto propertyName = luaL_checklstring(l, 1,
nullptr);
1045 lua_pushnumber(l, result);
1049#if EFI_TUNER_STUDIO && (EFI_PROD_CODE || EFI_SIMULATOR)
1050 lua_register(lState,
"getOutput", [](lua_State* l) {
1051 auto propertyName = luaL_checklstring(l, 1,
nullptr);
1055 lua_pushnumber(l, result);
1060#if EFI_SHAFT_POSITION_INPUT
1061 lua_register(lState,
"getEngineState", [](lua_State* l) {
1072 lua_pushinteger(l, luaStateCode);
1077 lua_register(lState,
"setCalibration", [](lua_State* l) {
1078 auto propertyName = luaL_checklstring(l, 1,
nullptr);
1079 auto value = luaL_checknumber(l, 2);
1080 auto incrementVersion = lua_toboolean(l, 3);
1083 efiPrintf(
"LUA: applying [%s][%f]", propertyName, value);
1085 efiPrintf(
"LUA: invalid calibration key [%s]", propertyName);
1087 if (incrementVersion) {
1092 lua_register(lState, CMD_BURNCONFIG, [](lua_State*) {
1097 lua_register(lState,
"getGlobalConfigurationVersion", [](lua_State* l) {
1102 lua_register(lState,
"setAcDisabled", [](lua_State* l) {
1103 auto value = lua_toboolean(l, 1);
1107 lua_register(lState,
"getTimeSinceAcToggleMs", [](lua_State* l) {
1109 lua_pushnumber(l, result);
1117 lua_register(lState,
"getFan", [](lua_State* l) {
1121 lua_register(lState,
"getFan2", [](lua_State* l) {
1125 lua_register(lState,
"getAcRelay", [](lua_State* l) {
1132#if EFI_ENGINE_CONTROL
1138#ifndef WITH_LUA_STOP_ENGINE
1139#define WITH_LUA_STOP_ENGINE TRUE
1142#if WITH_LUA_STOP_ENGINE
1143 lua_register(lState,
"isFirmwareError", [](lua_State* l) {
1144 lua_pushboolean(l, hasFirmwareError());
1147#if EFI_SHAFT_POSITION_INPUT
1148 lua_register(lState,
"stopEngine", [](lua_State*) {
1152 lua_register(lState,
"isEngineStopRequested", [](lua_State* l) {
1154 lua_pushboolean(l, result);
1157 lua_register(lState,
"getTimeSinceTriggerEventMs", [](lua_State* l) {
1159 lua_pushinteger(l, result);
1171#if EFI_CAN_SUPPORT || EFI_UNIT_TEST
1172 lua_register(lState,
"txCan",
lua_txCan);
1185#if EFI_PROD_CODE && HW_HELLEN
1186 lua_register(lState,
"hellenEnablePower", [](lua_State*) {
1190 lua_register(lState,
"hellenDisablePower", [](lua_State*) {
1197 lua_register(lState,
"setDacVoltage", [](lua_State* l) {
1198 auto channel = luaL_checkinteger(l, 1);
1199 auto voltage = luaL_checknumber(l, 2);
1205 LuaClass<SignalDebounce> luaDebounce(lState,
"SignalDebounce");
1212 lua_register(lState,
"advanceTimeUs", [](lua_State *l){
1213 auto us = luaL_checknumber(l, 1);
int luaCommandCounters[LUA_BUTTON_COUNT]
void addLuaCanRxFilter(int32_t eid, uint32_t mask, int bus, int callback)
Timer timeSinceStateChange
TriggerCentral triggerCentral
int getGlobalConfigurationVersion() const
IgnitionState ignitionState
SingleTimerExecutor scheduler
LaunchControlBase launchController
RpmCalculator rpmCalculator
AntilagSystemBase antilagController
IEtbController * etbControllers[ETB_COUNT]
TunerStudioOutputChannels outputChannels
constexpr auto & module()
RegisteredOutputPin fanRelay
OutputPin luaOutputPins[LUA_PWM_COUNT]
RegisteredOutputPin fanRelay2
RegisteredOutputPin acRelay
ShutdownController shutdownController
void setAirmass(AirmassResult airmass)
bool getLogicValue() const
spinning_state_e getState() const
virtual bool hasSensor() const
virtual SensorResult get() const =0
virtual bool isRedundant() const
virtual float getRaw() const
static float getOrZero(SensorType type)
const char * getSensorName() const
bool isEngineStop(efitick_t nowNt) const
void setSimplePwmDutyCycle(float dutyCycle) override
Base class for sensors that compute a value on one thread, and want to make it available to consumers...
void showInfo(const char *sensorName) const override
void setValidValue(float value, efitick_t timestamp)
virtual void setTimeout(int timeoutMs)
SensorResult get() const final override
bool directSelfStimulation
float getConsumedGramsRemainder() const
float getConsumptionGramPerSecond() const
uint32_t getConsumedGrams() const
virtual float getValue(float xColumn, float yRow) const =0
void setDacVoltage(int channel, float voltage)
ioportid_t getHwPort(const char *msg, brain_pin_e brainPin)
brain_pin_e parseBrainPin(const char *str)
ioportmask_t getHwPin(const char *msg, brain_pin_e brainPin)
const char * boolToString(bool value)
void advanceTimeUs(int us)
void setEtbLuaAdjustment(percent_t pos)
void setEwgLuaAdjustment(percent_t pos)
void doInitElectronicThrottle(bool isStartupInit)
LimpManager * getLimpManager()
static EngineAccessor engine
void incrementGlobalConfigurationVersion(const char *msg)
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
AirmassModelBase * getAirmassModel(engine_load_mode_e mode)
void hellenEnableEn(const char *msg)
void hellenDisableEn(const char *msg)
StoredValueSensor luaGauges[]
bool efiReadPin(brain_pin_e pin)
UNUSED(samplingTimeSeconds)
size_t getLuaCanRxDropped()
static int lua_setPwmFreq(lua_State *l)
void startPwm(int index, float freq, float duty)
static auto lua_getAirmassResolveMode(lua_State *l)
static int lua_readpin(lua_State *l)
PUBLIC_API_WEAK void boardConfigureLuaHooks(lua_State *lState)
int lua_canRxAddMask(lua_State *l)
static int lua_txCan(lua_State *l)
int getLuaFunc(lua_State *l)
void setPwmDuty(int index, float duty)
uint32_t getLuaArray(lua_State *l, int paramIndex, uint8_t *data, uint32_t size)
static int lua_setAirmass(lua_State *l)
static SimplePwm pwms[LUA_PWM_COUNT]
static int lua_getDigital(lua_State *l)
bool getAuxDigital(int index)
static int lua_getAuxDigital(lua_State *l)
static SensorType findSensorByName(lua_State *l, const char *name)
static LuaAirmass luaAirmass
static int lua_getAuxAnalog(lua_State *l)
static int lua_getSensorByIndex(lua_State *l)
void configureRusefiLuaHooks(lua_State *lState)
static int validateCanChannelAndConvertFromHumanIntoZeroIndex(lua_State *l)
static int lua_hasSensor(lua_State *l)
static int lua_getSensorByName(lua_State *l)
AirmassModelBase & getLuaAirmassModel()
static int lua_getAirmass(lua_State *l)
static int lua_setPwmDuty(lua_State *l)
static int lua_getSensorRaw(lua_State *l)
static int getSensor(lua_State *l, SensorType type)
static bool isFunction(lua_State *l, int idx)
int lua_canRxAdd(lua_State *l)
static int lua_setDebug(lua_State *l)
static int lua_startPwm(lua_State *l)
static int lua_vin(lua_State *l)
static P luaL_checkPwmIndex(lua_State *l, int pos)
void configureRusefiLuaUtilHooks(lua_State *lState)
float getOutputValueByName(const char *name)
const char * hwPortname(brain_pin_e brainPin)
bool isBrainPinValid(brain_pin_e brainPin)
void startSimplePwmExt(SimplePwm *state, const char *msg, Scheduler *executor, brain_pin_e brainPin, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *callback)
float getCurveValue(int index, float key)
ValueProvider3D * getscriptTable(int index)
SensorType findSensorTypeByName(const char *name)
luaAdjustment("ETB: luaAdjustment", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1828, 1.0, 0.0, 3.0, "%")
state("state", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1871, 1.0, -1.0, -1.0, "")
float getSentValue(SentInput input)
int getSentValues(SentInput input, uint16_t *sig0, uint16_t *sig1)
This file is about configuring engine via the human-readable protocol.
void doScheduleStopEngine(StopRequestedReason reason)
bool disableDecelerationFuelCutOff
bool torqueReductionState
void configureLowpass(float samplingFrequency, float cutoffFrequency)
float filter(float input)
void setOffset(float offset)
void setDerivativeFilterLoss(float derivativeFilterLoss)
void setAntiwindupFreq(float antiwindupFreq)
float get(float target, float input)
float get(float target, float input)
void setOffset(float offset)
scaled_channel< int16_t, 2, 1 > luaTargetAdd
can_baudrate_e canBaudRate
engine_load_mode_e fuelAlgorithm
can_baudrate_e can2BaudRate
bool enableExtendedCanBroadcast
switch_input_pin_e luaDigitalInputPins[LUA_DIGITAL_INPUT_COUNT]
output_pin_e luaOutputPins[LUA_PWM_COUNT]
scaled_channel< uint8_t, 2, 1 > gppwmOutput[4]
uint16_t torqueLoadBins[TORQUE_CURVE_SIZE]
uint16_t torqueRpmBins[TORQUE_CURVE_RPM_SIZE]
scaled_channel< uint8_t, 1, 10 > torqueTable[TORQUE_CURVE_SIZE][TORQUE_CURVE_RPM_SIZE]
scaled_channel< uint8_t, 1, 20 > cltIdleRpm[CLT_CURVE_SIZE]
void setLinearCurve(TValue(&array)[TSize], float from, float to, float precision=0.01f)
void tinymt32_init(tinymt32_t *random, uint32_t seed)
Tiny Mersenne Twister only 127 bit internal state.
static float tinymt32_generate_float(tinymt32_t *random)
void disableTriggerStimulator()
void setTriggerEmulatorRPM(int rpm)
void enableTriggerStimulator(bool incGlobalConfiguration)
void updateTunerStudioState()
int getSecondsSinceChannelsRequest()
bool setConfigValueByName(const char *name, float value)
float getConfigValueByName(const char *name)