more curves! also names for curves

This commit is contained in:
rusefillc 2021-11-04 23:22:37 -04:00
parent 85984928ca
commit 77be92e2c3
2 changed files with 18 additions and 8 deletions

View File

@ -604,6 +604,16 @@ ValueProvider3D *getFSIOTable(int index) {
}
}
float getCurveValue(int index, float key) {
// not great code at all :(
switch (index) {
default:
return interpolate2d(key, engineConfiguration->scriptCurve1Bins, engineConfiguration->scriptCurve1);
case 5:
return interpolate2d(key, engineConfiguration->scriptCurve5Bins, engineConfiguration->scriptCurve5);
}
}
void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
#if EFI_UNIT_TEST
// only unit test needs this

View File

@ -1359,14 +1359,14 @@ custom stepper_num_micro_steps_e 1 bits, U08, @OFFSET@, [0:3], @@stepper_num_mic
uint8_t fan2OnTemperature;+Cooling fan turn-on temperature threshold, in Celsius;"deg C", 1, 0, 0, 150, 0
uint8_t fan2OffTemperature;+Cooling fan turn-off temperature threshold, in Celsius;"deg C", 1, 0, 0, 150, 0
#define SCRIPT_CURVE_COUNT 6
float[FSIO_CURVE_16] fsioCurve1Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_16] fsioCurve1;;"y", 1, 0, -999, 1000, 3
float[FSIO_CURVE_16] fsioCurve2Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_16] fsioCurve2;;"y", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] fsioCurve3Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] fsioCurve3;;"y", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] fsioCurve4Bins;;"x", 1, 0, -999, 1000, 3
float[FSIO_CURVE_8] fsioCurve4;;"y", 1, 0, -999, 1000, 3
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
brain_input_pin_e flexSensorPin;+Continental/GM flex fuel sensor, 50-150hz type;
brain_pin_e test557pin