Change range matrix to float

This commit is contained in:
David Holdeman 2024-04-04 23:01:27 -05:00 committed by rusefillc
parent ebe1175d04
commit 975f178da1
4 changed files with 17 additions and 17 deletions

View File

@ -23,10 +23,10 @@ void GenericGearController::update() {
// Loop through possible range states
// 1-9 because 0 is SelectedGear::Invalid
for (int i = 1; i <= 9; i++) {
uint8_t *rangeStates = getRangeStateArray(i);
float *rangeStates = getRangeStateArray(i);
// Loop through inputs
for (size_t p = 0; p < efi::size(engineConfiguration->tcu_rangeInput); p++) {
int cellState = rangeStates[p];
float cellState = rangeStates[p];
// If the pin isn't configured and it matters, or if we've locked out this range with 3 in a cell
if ((!isBrainPinValid(engineConfiguration->tcu_rangeInput[p]) && cellState != 2) || cellState == 3) {
gear = SelectedGear::Invalid;

View File

@ -71,7 +71,7 @@ void initGearController() {
engine->gearController->init();
}
uint8_t* GearControllerBase::getRangeStateArray(int i) {
float* GearControllerBase::getRangeStateArray(int i) {
switch (i) {
case 1 :
return config->tcu_rangePlus;

View File

@ -20,7 +20,7 @@ public:
protected:
virtual gear_e setDesiredGear(gear_e);
void initTransmissionController();
uint8_t* getRangeStateArray(int);
float* getRangeStateArray(int);
private:
gear_e desiredGear = NEUTRAL;
void postState();

View File

@ -96,13 +96,13 @@
! this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version
! todo: this not needed in light of TS_SIGNATURE but rusEFI console still uses it. Need to migrate
! rusEFI console from TS_FILE_VERSION to TS_SIGNATURE :(
#define TS_FILE_VERSION 20240101
#define TS_FILE_VERSION 20240404
! This is the version of the data stored in flash configuration
! Any time an incompatible change is made to the configuration format stored in flash,
! update this string to the current date! It is required to also update TS_SIGNATURE above
! when this happens.
#define FLASH_DATA_VERSION 20015
#define FLASH_DATA_VERSION 20016
! this offset is part of console compatibility mechanism, please DO NOT change this offset
#define TS_FILE_VERSION_OFFSET 124
@ -1892,17 +1892,17 @@ uint16_t[12] autoscale throttleEstimateEffectiveAreaValues;In units of g/s norma
blend_table_s[BOOST_BLEND_COUNT iterate] boostOpenLoopBlends
blend_table_s[BOOST_BLEND_COUNT iterate] boostClosedLoopBlends
uint8_t[6] tcu_rangeP;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeR;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeN;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeD;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeM;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeM3;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeM2;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeM1;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangePlus;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeMinus;;"level", 1, 0, 0, 3, 0
uint8_t[6] tcu_rangeLow;;"level", 1, 0, 0, 3, 0
float[RANGE_INPUT_COUNT] tcu_rangeP;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeR;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeN;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeD;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeM;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeM3;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeM2;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeM1;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangePlus;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeMinus;;"level", 1, 0, 0, 200000, 0
float[RANGE_INPUT_COUNT] tcu_rangeLow;;"level", 1, 0, 0, 200000, 0
uint8_t[4 x 4] autoscale lambdaMaxDeviationTable;;"lambda", 0.01, 0, 0, 1, 2
uint16_t[4] lambdaMaxDeviationLoadBins;;"", 1, 0, 0, 1000, 0