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);
177 luaL_argcheck(l,
channel >= 1 &&
channel <= EFI_CAN_BUS_COUNT, 1,
"Invalid bus index");
187 if (lua_gettop(l) == 2) {
189 id = luaL_checkinteger(l, 1);
194 id = luaL_checkinteger(l, 2);
195 ext = luaL_checkinteger(l, 3);
201 luaL_argcheck(l,
id <= 0x7FF, 2,
"ID specified is greater than max std ID");
203 luaL_argcheck(l,
id <= 0x1FFF'FFFF, 2,
"ID specified is greater than max ext ID");
214 luaL_checktype(l, dataIndex, LUA_TTABLE);
216 lua_pushnumber(l, dlc + 1);
217 auto elementType = lua_gettable(l, dataIndex);
218 auto val = lua_tonumber(l, -1);
221 if (elementType == LUA_TNIL) {
226 if (elementType != LUA_TNUMBER) {
228 luaL_error(l,
"Unexpected CAN data at position %d: %s", dlc, lua_tostring(l, -1));
235 luaL_error(l,
"CAN frame length cannot be longer than 8");
263 auto channel = luaL_checkinteger(l, pos);
267 if (channel < 0 || channel >= LUA_PWM_COUNT) {
268 luaL_error(l,
"setPwmDuty invalid channel %d",
channel);
275#define PWM_FREQ_PWM 1000
280 freq = clampF(1, freq, 1000);
290 efiPrintf(
"LUA PWM on %s at %f initial duty",
292 PERCENT_MULT *
duty);
297 auto freq = luaL_checknumber(l, 2);
298 auto duty = luaL_checknumber(l, 3);
300 if (duty < 0 || duty > PWM_MAX_DUTY) {
301 luaL_error(l,
"Duty parameter should be from 0 to 1 got %f",
duty);
326 auto duty = luaL_checknumber(l, 2);
334 auto freq = luaL_checknumber(l, 2);
337 freq = clampF(1, freq, 1000);
339 p.pwm.setFrequency(freq);
345 auto idx = luaL_checkinteger(l, 1);
360 lua_pushboolean(l,
state);
374 auto idx = luaL_checkinteger(l, 1);
375 if (idx < 0 || idx >= LUA_DIGITAL_INPUT_COUNT) {
389 lua_pushboolean(l,
state);
401 auto idx = luaL_checkinteger(l, 1);
402 auto val = luaL_checknumber(l, 2);
405 if (idx < 1 || idx > 7) {
410 firstDebugField[idx - 1] = val;
415#if EFI_ENGINE_CONTROL
417 if (lua_gettop(l) == 0) {
421 return static_cast<engine_load_mode_e
>(luaL_checkinteger(l, 1));
430 return luaL_error(l,
"null airmass");
434 auto result = airmass->getAirmass(rpm,
false).CylinderAirmass;
436 lua_pushnumber(l, result);
441 float airmass = luaL_checknumber(l, 1);
442 float engineLoadPercent = luaL_checknumber(l, 2);
444 airmass = clampF(0, airmass, 10);
445 engineLoadPercent = clampF(0, engineLoadPercent, 1000);
457 template<
typename TCLASS,
typename ...ARGS>
458 struct PlacementConstructorCaller<TCLASS, lua_State*, ARGS...>
463 static TCLASS * Invoke(lua_State *
state,
void * mem)
465 return InvokeImpl(
state, mem,
typename make_indices<
sizeof...(ARGS)>::type());
469 template<std::size_t ...Ns>
470 static TCLASS * InvokeImpl(lua_State *
state,
void * mem, indices<Ns...>)
473 return new(mem) TCLASS(
state, LuaStack<ARGS>::get(
state, Ns + 1)...);
479 LuaSensor() : LuaSensor(nullptr,
"Invalid") { }
485 LuaSensor(lua_State* l,
const char* name)
490 luaL_error(l,
"Tried to create a Lua sensor of type %s, but one was already registered.",
getSensorName());
493 efiPrintf(
"LUA registered sensor of type %s",
getSensorName());
498 return m_isRedundant;
506 void setRedundant(
bool value) {
507 m_isRedundant = value;
510 void set(
float value) {
518 void showInfo(
const char* sensorName)
const override {
519 const auto value =
get();
520 efiPrintf(
"Sensor \"%s\": Lua sensor: Valid: %s Converted value %.2f", sensorName,
boolToString(value.Valid), value.Value);
524 bool m_isRedundant =
false;
528 return lua_type(l, idx) == LUA_TFUNCTION;
533 return luaL_error(l,
"expected function");
535 return luaL_ref(l, LUA_REGISTRYINDEX);
545 int callback = NO_CALLBACK;
546 int argumentCount = lua_gettop(l);
548 switch (argumentCount) {
551 eid = luaL_checkinteger(l, 1);
557 eid = luaL_checkinteger(l, 1);
563 eid = luaL_checkinteger(l, 2);
570 eid = luaL_checkinteger(l, 2);
576 return luaL_error(l,
"Wrong number of arguments to canRxAdd. Got %d, expected 1, 2, or 3.", argumentCount);
590 int callback = NO_CALLBACK;
592 switch (lua_gettop(l)) {
595 eid = luaL_checkinteger(l, 1);
596 mask = luaL_checkinteger(l, 2);
602 eid = luaL_checkinteger(l, 1);
603 mask = luaL_checkinteger(l, 2);
610 eid = luaL_checkinteger(l, 2);
611 mask = luaL_checkinteger(l, 3);
618 eid = luaL_checkinteger(l, 2);
619 mask = luaL_checkinteger(l, 3);
626 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 configureRusefiLuaHooksExt(lua_State *)
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, 1836, 1.0, 0.0, 3.0, "%")
state("state", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1879, 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)