Epic: Remove FSIO #2928

This commit is contained in:
rusefillc 2021-11-14 10:39:47 -05:00
parent b223139c3b
commit 5f1aadf638
13 changed files with 96 additions and 98 deletions

View File

@ -36,7 +36,7 @@ const float mazda_miata_nb2_LoadBins[FUEL_LOAD_COUNT] = {20.0, 25.0, 30.0, 35.0,
135.0, 158.0, 185.0, 220.0}
;
static uint8_t const fsio_table_dyno[FSIO_TABLE_8][FSIO_TABLE_8] = {
static uint8_t const SCRIPT_TABLE__dyno[SCRIPT_TABLE__8][SCRIPT_TABLE__8] = {
/* Generated by TS2C on Sun May 07 09:35:13 EDT 2017*/
{/* 0 30.000 *//* 0 700.0*/1, /* 1 1000.0*/3, /* 2 2000.0*/10, /* 3 3000.0*/20, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, },
{/* 1 40.000 *//* 0 700.0*/3, /* 1 1000.0*/10, /* 2 2000.0*/19, /* 3 3000.0*/26, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, },
@ -84,7 +84,7 @@ static const float mazda_miata_nb2_targetLambdaLoadBins[FUEL_LOAD_COUNT] = {10.0
void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setMazdaMiata2003EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
copyTable(config->fsioTable1, fsio_table_dyno);
copyTable(config->scriptTable1, SCRIPT_TABLE__dyno);
copyArray(config->veRpmBins, mazda_miata_nb2_RpmBins);
copyArray(config->veLoadBins, mazda_miata_nb2_LoadBins);

View File

@ -71,15 +71,15 @@ static const float injectorLagCorrection[VBAT_INJECTOR_CURVE_SIZE] = {
1.5 , 1.35, 1.25 , 1.20
};
static const float vvt18fsioRpmBins[FSIO_TABLE_8] =
static const float vvt18fsioRpmBins[SCRIPT_TABLE__8] =
{700.0, 1000.0, 2000.0, 3000.0, 3500.0, 4500.0, 5500.0, 6500.0}
;
static const float vvt18fsioLoadBins[FSIO_TABLE_8] =
static const float vvt18fsioLoadBins[SCRIPT_TABLE__8] =
{30.0, 40.0, 50.0, 60.0, 70.0, 75.0, 82.0, 85.0}
;
static const uint8_t fsio_table_vvt_target[FSIO_TABLE_8][FSIO_TABLE_8] = {
static const uint8_t SCRIPT_TABLE__vvt_target[SCRIPT_TABLE__8][SCRIPT_TABLE__8] = {
/* Generated by TS2C on Mon Feb 13 19:11:32 EST 2017*/
{/* 0 30 *//* 0 700.0*/1, /* 1 1000.0*/3, /* 2 2000.0*/10, /* 3 3000.0*/20, /* 4 3500.0*/27, /* 5 4500.0*/28, /* 6 5500.0*/11, /* 7 6500.0*/5, },
{/* 1 40 *//* 0 700.0*/3, /* 1 1000.0*/10, /* 2 2000.0*/19, /* 3 3000.0*/26, /* 4 3500.0*/30, /* 5 4500.0*/28, /* 6 5500.0*/11, /* 7 6500.0*/5, },
@ -237,7 +237,7 @@ void setMazdaMiataNbInjectorLag(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
void setMazdaNB2VVTSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
copyArray(config->vvtTable1RpmBins, vvt18fsioRpmBins);
copyArray(config->vvtTable1LoadBins, vvt18fsioLoadBins);
copyTable(config->vvtTable1, fsio_table_vvt_target);
copyTable(config->vvtTable1, SCRIPT_TABLE__vvt_target);
// VVT closed loop
engineConfiguration->auxPid[0].pFactor = 2;

View File

@ -561,17 +561,17 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
setLinearCurve(engineConfiguration->map.samplingWindow, 50, 50, 1);
setLinearCurve(config->vvtTable1LoadBins, 20, 120, 10);
setRpmTableBin(config->vvtTable1RpmBins, FSIO_TABLE_8);
setRpmTableBin(config->vvtTable1RpmBins, SCRIPT_TABLE__8);
setLinearCurve(config->vvtTable2LoadBins, 20, 120, 10);
setRpmTableBin(config->vvtTable2RpmBins, FSIO_TABLE_8);
setLinearCurve(config->fsioTable1LoadBins, 20, 120, 10);
setRpmTableBin(config->fsioTable1RpmBins, FSIO_TABLE_8);
setLinearCurve(config->fsioTable2LoadBins, 20, 120, 10);
setRpmTableBin(config->fsioTable2RpmBins, FSIO_TABLE_8);
setLinearCurve(config->fsioTable3LoadBins, 20, 120, 10);
setRpmTableBin(config->fsioTable3RpmBins, FSIO_TABLE_8);
setLinearCurve(config->fsioTable4LoadBins, 20, 120, 10);
setRpmTableBin(config->fsioTable4RpmBins, FSIO_TABLE_8);
setRpmTableBin(config->vvtTable2RpmBins, SCRIPT_TABLE__8);
setLinearCurve(config->scriptTable1LoadBins, 20, 120, 10);
setRpmTableBin(config->scriptTable1RpmBins, SCRIPT_TABLE__8);
setLinearCurve(config->scriptTable2LoadBins, 20, 120, 10);
setRpmTableBin(config->scriptTable2RpmBins, SCRIPT_TABLE__8);
setLinearCurve(config->scriptTable3LoadBins, 20, 120, 10);
setRpmTableBin(config->scriptTable3RpmBins, SCRIPT_TABLE__8);
setLinearCurve(config->scriptTable4LoadBins, 20, 120, 10);
setRpmTableBin(config->scriptTable4RpmBins, SCRIPT_TABLE__8);
setDefaultEngineNoiseTable(PASS_ENGINE_PARAMETER_SIGNATURE);

View File

@ -102,7 +102,7 @@ typedef char le_formula_t[LE_COMMAND_LENGTH];
typedef brain_pin_e egt_cs_array_t[EGT_CHANNEL_COUNT];
typedef int16_t fsio_pwm_freq_t;
typedef int16_t pwm_freq_t;
typedef float fsio_setting_t;

View File

@ -12,17 +12,17 @@
#include "rusefi_lua.h"
typedef float fsio_table_8x8_f32t_linear[FSIO_TABLE_8 * FSIO_TABLE_8];
typedef float SCRIPT_TABLE__8x8_f32t_linear[SCRIPT_TABLE__8 * SCRIPT_TABLE__8];
bool acceptCanRx(int sid DECLARE_ENGINE_PARAMETER_SUFFIX) {
if (!CONFIG(useFSIOTableForCanSniffingFiltering)) {
if (!CONFIG(usescriptTableForCanSniffingFiltering)) {
// accept anything if filtering is not enabled
return true;
}
/*
// the whole table reuse and 2D table cast to 1D array is a major hack, but it's OK for prototyping
fsio_table_8x8_f32t_linear *array =
(fsio_table_8x8_f32t_linear*) (void*) &config->fsioTable1;
SCRIPT_TABLE__8x8_f32t_linear *array =
(SCRIPT_TABLE__8x8_f32t_linear*) (void*) &config->scriptTable1;
int arraySize = efi::size(*array);

View File

@ -212,16 +212,16 @@ FsioResult LECalculator::processElement(const LEElement *element DECLARE_ENGINE_
return unexpected;
}
}
case LE_METHOD_FSIO_TABLE: {
float i = pop(LE_METHOD_FSIO_TABLE);
float yValue = pop(LE_METHOD_FSIO_TABLE);
float xValue = pop(LE_METHOD_FSIO_TABLE);
case LE_METHOD_SCRIPT_TABLE_: {
float i = pop(LE_METHOD_SCRIPT_TABLE_);
float yValue = pop(LE_METHOD_SCRIPT_TABLE_);
float xValue = pop(LE_METHOD_SCRIPT_TABLE_);
int index = (int) i;
if (index < 1 || index > MAX_TABLE_INDEX) {
return unexpected;
} else {
// index parameter is 1-based, getFSIOTable is 0-based
return getFSIOTable(index - 1)->getValue(xValue, yValue);
// index parameter is 1-based, getscriptTable is 0-based
return getscriptTable(index - 1)->getValue(xValue, yValue);
}
}
case LE_METHOD_FSIO_DIGITAL_INPUT:

View File

@ -40,7 +40,7 @@ typedef enum {
LE_METHOD_VBATT = 109,
LE_METHOD_AC_TOGGLE = 110,
LE_METHOD_TIME_SINCE_AC_TOGGLE = 111,
LE_METHOD_FSIO_TABLE = 113,
LE_METHOD_SCRIPT_TABLE_ = 113,
LE_METHOD_SELF = 114,
LE_METHOD_MAP = 115,
LE_METHOD_FSIO_ANALOG_INPUT = 116,

View File

@ -31,10 +31,10 @@
*/
#define NO_PWM 0
static fsio8_Map3D_f32t fsioTable1;
static fsio8_Map3D_u8t fsioTable2;
static fsio8_Map3D_u8t fsioTable3;
static fsio8_Map3D_u8t fsioTable4;
static fsio8_Map3D_f32t scriptTable1;
static fsio8_Map3D_u8t scriptTable2;
static fsio8_Map3D_u8t scriptTable3;
static fsio8_Map3D_u8t scriptTable4;
/**
* Here we define all rusEfi-specific methods
@ -57,7 +57,7 @@ static LENameOrdinalPair leAcToggle(LE_METHOD_AC_TOGGLE, "ac_on_switch");
static LENameOrdinalPair leTimeSinceAcToggle(LE_METHOD_TIME_SINCE_AC_TOGGLE, "time_since_ac_on_switch");
static LENameOrdinalPair leTimeSinceBoot(LE_METHOD_TIME_SINCE_BOOT, "time_since_boot");
static LENameOrdinalPair leFsioSetting(LE_METHOD_FSIO_SETTING, FSIO_METHOD_FSIO_SETTING);
static LENameOrdinalPair leFsioTable(LE_METHOD_FSIO_TABLE, FSIO_METHOD_FSIO_TABLE);
static LENameOrdinalPair lescriptTable(LE_METHOD_SCRIPT_TABLE_, FSIO_METHOD_SCRIPT_TABLE_);
static LENameOrdinalPair leFsioAnalogInput(LE_METHOD_FSIO_ANALOG_INPUT, FSIO_METHOD_FSIO_ANALOG_INPUT);
static LENameOrdinalPair leFsioDigitalInput(LE_METHOD_FSIO_DIGITAL_INPUT, FSIO_METHOD_FSIO_DIGITAL_INPUT);
static LENameOrdinalPair leIntakeVVT(LE_METHOD_INTAKE_VVT, "ivvt");
@ -312,16 +312,16 @@ static void showFsioInfo(void) {
#endif
}
ValueProvider3D *getFSIOTable(int index) {
ValueProvider3D *getscriptTable(int index) {
switch (index) {
default:
return &fsioTable1;
return &scriptTable1;
case 1:
return &fsioTable2;
return &scriptTable2;
case 2:
return &fsioTable3;
return &scriptTable3;
case 3:
return &fsioTable4;
return &scriptTable4;
}
}
@ -381,14 +381,14 @@ void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (isBrainPinValid(CONFIG(starterRelayDisablePin)))
starterRelayDisableLogic = sysPool.parseExpression(STARTER_RELAY_LOGIC);
fsioTable1.init(config->fsioTable1, config->fsioTable1LoadBins,
config->fsioTable1RpmBins);
fsioTable2.init(config->fsioTable2, config->fsioTable2LoadBins,
config->fsioTable2RpmBins);
fsioTable3.init(config->fsioTable3, config->fsioTable3LoadBins,
config->fsioTable3RpmBins);
fsioTable4.init(config->fsioTable4, config->fsioTable4LoadBins,
config->fsioTable4RpmBins);
scriptTable1.init(config->scriptTable1, config->scriptTable1LoadBins,
config->scriptTable1RpmBins);
scriptTable2.init(config->scriptTable2, config->scriptTable2LoadBins,
config->scriptTable2RpmBins);
scriptTable3.init(config->scriptTable3, config->scriptTable3LoadBins,
config->scriptTable3RpmBins);
scriptTable4.init(config->scriptTable4, config->scriptTable4LoadBins,
config->scriptTable4RpmBins);
}

View File

@ -17,8 +17,8 @@
// see useFSIO5ForCriticalIssueEngineStop
#define MAGIC_OFFSET_FOR_CRITICAL_ENGINE 5
typedef Map3D<FSIO_TABLE_8, FSIO_TABLE_8, float, float, float> fsio8_Map3D_f32t;
typedef Map3D<FSIO_TABLE_8, FSIO_TABLE_8, uint8_t, float, float> fsio8_Map3D_u8t;
typedef Map3D<SCRIPT_TABLE__8, SCRIPT_TABLE__8, float, float, float> fsio8_Map3D_f32t;
typedef Map3D<SCRIPT_TABLE__8, SCRIPT_TABLE__8, uint8_t, float, float> fsio8_Map3D_u8t;
expected<float> getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX);
@ -31,5 +31,5 @@ void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE);
float getCurveValue(int index, float key DECLARE_ENGINE_PARAMETER_SUFFIX);
int getCurveIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX);
int getTableIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX);
ValueProvider3D *getFSIOTable(int index);
ValueProvider3D *getscriptTable(int index);

View File

@ -95,7 +95,7 @@ static int lua_table3d(lua_State* l) {
auto y = luaL_checknumber(l, 3);
// index table, compute table lookup
auto result = getFSIOTable(tableIdx)->getValue(x, y);
auto result = getscriptTable(tableIdx)->getValue(x, y);
lua_pushnumber(l, result);
return 1;

View File

@ -72,8 +72,8 @@
// Human-readable: rpm < cranking_rpm
#define STARTER_RELAY_LOGIC "rpm cranking_rpm <"
// Human-readable: fsio_table (3, rpm, map) / 100
#define BOOST_CONTROLLER "3 rpm map fsio_table 100 /"
// Human-readable: SCRIPT_TABLE_ (3, rpm, map) / 100
#define BOOST_CONTROLLER "3 rpm map SCRIPT_TABLE_ 100 /"
// Human-readable: if(fsio_analog_input (0) > 20, 0, 10)
#define ANALOG_CONDITION "0 fsio_analog_input 20 > 0 10 if"

View File

@ -86,7 +86,6 @@ struct_no_prefix engine_configuration_s
#define ENUM_32_BITS 2000000000
#define AUX_ANALOG_INPUT_COUNT 8
#define FSIO_ANALOG_INPUT_COUNT 4
#define LUA_PWM_COUNT 8
#define LUA_ANALOG_INPUT_COUNT 8
@ -164,7 +163,6 @@ struct_no_prefix engine_configuration_s
#define TRIGGER_SIMULATOR_PIN_COUNT 3
#define TRIGGER_INPUT_PIN_COUNT 3
#define LOGIC_ANALYZER_CHANNEL_COUNT 4
#define FSIO_COMMAND_COUNT 6
#define SCRIPT_SETTING_COUNT 8
#define VEHICLE_INFO_SIZE 32
@ -213,10 +211,10 @@ struct_no_prefix engine_configuration_s
#define PACK_MULT_FUEL_MASS 100
#define PACK_PERCENT_BYTE_MULT 100.0
#define PACK_MULT_FUEL_FLOW 200
#define FSIO_TABLE_8 8
#define SCRIPT_TABLE_8 8
#define FSIO_CURVE_8 8
#define FSIO_CURVE_16 16
#define SCRIPT_CURVE_8 8
#define SCRIPT_CURVE_16 16
#define FSIO_METHOD_FSIO_SETTING "fsio_setting"
#define FSIO_METHOD_FSIO_TABLE "fsio_table"
@ -273,9 +271,9 @@ struct pid_s
float pFactor;;"", 1, 0, -10000, 10000, 4
float iFactor;;"", 1, 0, -10000, 10000, 4
float dFactor;;"", 1, 0, -10000, 10000, 4
int16_t fsio_visible offset;Linear addition to PID logic;"", 1, 0, -1000, 1000, 0
int16_t offset;Linear addition to PID logic;"", 1, 0, -1000, 1000, 0
int16_t periodMs;PID dTime;"ms", 1, 0, 0, 3000, 0
int16_t fsio_visible minValue;Output Min Duty Cycle;"", 1, 0, -30000, 30000, 0
int16_t minValue;Output Min Duty Cycle;"", 1, 0, -30000, 30000, 0
int16_t maxValue;Output Max Duty Cycle;"", 1, 0, -30000, 30000, 0
end_struct
@ -445,7 +443,7 @@ bit useRunningMathForCranking,"Fuel Map","Fixed";+For cranking either use the sp
bit displayLogicLevelsInEngineSniffer;+Shall we display real life signal or just the part consumed by trigger decoder.\nApplies to both trigger and cam/vvt input.\n\nenable logic_level_trigger
bit useTLE8888_stepper
bit enableMapEstimationTableFallback;+If enabled, the MAP estimate table will be used if the MAP sensor fails to estimate manifold pressure based on RPM and TPS.
bit useFSIOTableForCanSniffingFiltering
bit usescriptTableForCanSniffingFiltering
bit issue_294_29
bit artificialTestMisfire,"Danger Mode","No thank you";Experimental setting that will cause a misfire\nDO NOT ENABLE.
bit issue_294_31,"si_example","nada_example"
@ -706,7 +704,7 @@ custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:1], "Off", "Slow", "Fast"
brain_pin_e canRxPin;set_can_rx_pin X
pin_input_mode_e throttlePedalUpPinMode;
uint8_t fsio_visible acIdleExtraOffset;+Additional idle % while A/C is active;"%", 1, 0, 0, 100, 0
uint8_t acIdleExtraOffset;+Additional idle % while A/C is active;"%", 1, 0, 0, 100, 0
int can2SleepPeriodMs;+CANbus thread period, ms;"ms", 1, 0, 0, 1000, 2
uint16_t wastegatePositionMin;+Voltage when the wastegate is closed.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0
@ -1078,7 +1076,7 @@ bit unused_1484_bit_31
float idleStepperReactionTime;;"ms", 1, 0, 1, 300, 0
uint8_t[20] unusedFsioInputs;;"", 1, 0, 0, 255, 0
uint8_t[20] unused20Inputs;;"", 1, 0, 0, 255, 0
int idleStepperTotalSteps;;"count", 1, 0, 5, 3000, 0
@ -1143,7 +1141,7 @@ int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\
float throttlePedalUpVoltage;;"voltage", 1, 0, -6, 6, 2
float throttlePedalWOTVoltage;+Pedal in the floor;"voltage", 1, 0, -6, 6, 2
int16_t fsio_visible startUpFuelPumpDuration;+on ECU start turn fuel pump on to build fuel pressure;"seconds", 1, 0, 0, 6000, 0
int16_t startUpFuelPumpDuration;+on ECU start turn fuel pump on to build fuel pressure;"seconds", 1, 0, 0, 6000, 0
int16_t idlePidRpmDeadZone;+If the RPM closer to target than this value, disable closed loop idle correction to prevent oscillation;"RPM", 1, 0, 0, 200, 0
@ -1245,8 +1243,8 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0, 300, 2
float tChargeMaxRpmMinTps;;"mult", 1, 0, 0, 3, 4
float tChargeMaxRpmMaxTps;;"mult", 1, 0, 0, 3, 4
custom fsio_pwm_freq_t 2 scalar, U16, @OFFSET@, "Hz", 1, 0, 0, 3000, 0
fsio_pwm_freq_t[CAMS_PER_BANK iterate] vvtOutputFrequency;
custom pwm_freq_t 2 scalar, U16, @OFFSET@, "Hz", 1, 0, 0, 3000, 0
pwm_freq_t[CAMS_PER_BANK iterate] vvtOutputFrequency;
uint8_t fan1ExtraIdle;+Additional idle % when fan #1 is active;"%", 1, 0, 0, 100, 0
int alternatorPwmFrequency;;"Hz", 1, 0, 0, 3000, 0
int unused2260;;"units", 1, 0, -20, 100, 0
@ -1337,14 +1335,14 @@ custom stepper_num_micro_steps_e 1 bits, U08, @OFFSET@, [0:3], @@stepper_num_mic
uint8_t fan2OffTemperature;+Cooling fan turn-off temperature threshold, in Celsius;"deg C", 1, 0, 0, 150, 0
#define SCRIPT_CURVE_COUNT 6
#define SCRIPT_TABLE_COUNT 4
float[FSIO_CURVE_16] scriptCurve1Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_16] scriptCurve1;;"y", 1, 0, -999, 1000, 3
float[FSIO_CURVE_16] scriptCurve2Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_16] scriptCurve2;;"y", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] scriptCurve3Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] scriptCurve3;;"y", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] scriptCurve4Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] scriptCurve4;;"y", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_16] scriptCurve1Bins;;"x", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_16] scriptCurve1;;"y", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_16] scriptCurve2Bins;;"x", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_16] scriptCurve2;;"y", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve3Bins;;"x", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve3;;"y", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve4Bins;;"x", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve4;;"y", 1, 0, -999, 1000, 3
brain_input_pin_e flexSensorPin;+Continental/GM flex fuel sensor, 50-150hz type;
brain_pin_e test557pin
@ -1378,10 +1376,10 @@ int8_t[CLT_LIMITER_CURVE_SIZE] cltRevLimitRpmBins;CLT-based target RPM for hard
uint16_t[CLT_LIMITER_CURVE_SIZE] cltRevLimitRpm;See idleRpmPid;"", 1, 0, 0, 8000, 0
gppwm_note_t[SCRIPT_CURVE_COUNT iterate] scriptCurveName;
float[FSIO_CURVE_8] scriptCurve5Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] scriptCurve5;;"y", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] scriptCurve6Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] scriptCurve6;;"y", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve5Bins;;"x", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve5;;"y", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve6Bins;;"x", 1, 0, -999, 1000, 3
float[SCRIPT_CURVE_8] scriptCurve6;;"y", 1, 0, -999, 1000, 3
gppwm_note_t[SCRIPT_TABLE_COUNT iterate] scriptTableName;
uint8_t[236] unused3328;;"units", 1, 0, -20, 100, 0
@ -1538,7 +1536,7 @@ float[IDLE_ADVANCE_CURVE_SIZE] idleAdvance ;Optional timing advance table for
float[IDLE_VE_CURVE_SIZE] idleVeBins;Optional VE table for Idle (see useSeparateVEForIdle);"RPM", 1, 0, 0, 18000, 2
float[IDLE_VE_CURVE_SIZE] idleVe; Optional VE table for Idle (see useSeparateVEForIdle);"%", 1, 0, 0, 999, 2
le_formula_t[FSIO_COMMAND_COUNT iterate] fsioFormulas;
le_formula_t[6 iterate] fsioFormulas;
#define LUA_SCRIPT_SIZE 2000
custom lua_script_t @@LUA_SCRIPT_SIZE@@ string, ASCII, @OFFSET@, @@LUA_SCRIPT_SIZE@@
lua_script_t luaScript;
@ -1579,13 +1577,13 @@ uint16_t[FUEL_RPM_COUNT x FUEL_LOAD_COUNT] mapEstimateTable;;"kPa", {1/@@PACK_MU
uint16_t[FUEL_LOAD_COUNT] autoscale mapEstimateTpsBins;;"% TPS", {1/@@TPS_2_BYTE_PACKING_MULT@@}, 0, 0, 100, 1
uint16_t[FUEL_RPM_COUNT] mapEstimateRpmBins;;"RPM", 1, 0, 0, 18000, 0
uint8_t[FSIO_TABLE_8 x FSIO_TABLE_8] vvtTable1;;"value", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] vvtTable1LoadBins;;"L", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] vvtTable1RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] vvtTable1;;"value", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] vvtTable1LoadBins;;"L", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] vvtTable1RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[FSIO_TABLE_8 x FSIO_TABLE_8] vvtTable2;;"value", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] vvtTable2LoadBins;;"L", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] vvtTable2RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] vvtTable2;;"value", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] vvtTable2LoadBins;;"L", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] vvtTable2RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
float[64] unusedLuaWasHere;;"L", 1, 0, 0, 255, 0
@ -1615,21 +1613,21 @@ float[TPS_TPS_ACCEL_TABLE x TPS_TPS_ACCEL_TABLE] tpsTpsAccelTable;;"value", 1, 0
float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelFromRpmBins;;"from", 1, 0, 0, 30000, 2
float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelToRpmBins;RPM is float and not integer in order to use unified methods for interpolation;"to", 1, 0, 0, 25500, 2
float[FSIO_TABLE_8 x FSIO_TABLE_8] fsioTable1;;"value", 1, 0, 0, 30000, 2
float[FSIO_TABLE_8] fsioTable1LoadBins;;"L", 1, 0, 0, 30000, 2
float[FSIO_TABLE_8] fsioTable1RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
float[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] scriptTable1;;"value", 1, 0, 0, 30000, 2
float[SCRIPT_TABLE_8] scriptTable1LoadBins;;"L", 1, 0, 0, 30000, 2
float[SCRIPT_TABLE_8] scriptTable1RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[FSIO_TABLE_8 x FSIO_TABLE_8] fsioTable2;;"value", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] fsioTable2LoadBins;;"L", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] fsioTable2RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] scriptTable2;;"value", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] scriptTable2LoadBins;;"L", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] scriptTable2RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[FSIO_TABLE_8 x FSIO_TABLE_8] fsioTable3;;"value", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] fsioTable3LoadBins;;"L", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] fsioTable3RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] scriptTable3;;"value", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] scriptTable3LoadBins;;"L", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] scriptTable3RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[FSIO_TABLE_8 x FSIO_TABLE_8] fsioTable4;;"value", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] fsioTable4LoadBins;;"L", 1, 0, 0, 255, 0
float[FSIO_TABLE_8] fsioTable4RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
uint8_t[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] scriptTable4;;"value", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] scriptTable4LoadBins;;"L", 1, 0, 0, 255, 0
float[SCRIPT_TABLE_8] scriptTable4RpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0, 25500, 2
end_struct

View File

@ -47,10 +47,10 @@ end
TEST(LuaHooks, Table3d) {
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
setTable(config->fsioTable2, (uint8_t)33);
setTable(config->scriptTable2, (uint8_t)33);
EXPECT_EQ(testLuaReturnsNumber(tableTest), 33);
setTable(config->fsioTable2, (uint8_t)14);
setTable(config->scriptTable2, (uint8_t)14);
EXPECT_EQ(testLuaReturnsNumber(tableTest), 14);
}