Nissan MAF

This commit is contained in:
rusefillc 2022-11-10 11:10:55 -05:00
parent ba4257ca75
commit 99a587a951
1 changed files with 22 additions and 17 deletions

View File

@ -6,6 +6,10 @@ static int addMafPoint(persistent_config_s *e, int i, float kgHrValue, float vol
return i + 1;
}
static int addMafPointByVoltage(persistent_config_s *e, int i, float voltage, float kgHrValue) {
return addMafPoint(s, i, kgHrValue, voltage);
}
static void fillTheRest(persistent_config_s *e, int i) {
/**
* unrealistic values just to make binary search happy
@ -120,22 +124,23 @@ void setMazdaMiataNAMaf(persistent_config_s *e) {
void setNissanMAF0031(persistent_config_s *e) {
int i = 0;
i = addMafPoint(e, i, 0.29, 3.1768838175);
i = addMafPoint(e, i, 0.49, 3.6987752861);
i = addMafPoint(e, i, 0.72, 5.8013108424);
i = addMafPoint(e, i, 1, 11.1849);
i = addMafPoint(e, i, 1.37, 24.5646673361);
i = addMafPoint(e, i, 1.66, 41.453048941);
i = addMafPoint(e, i, 1.91, 61.5847903829);
i = addMafPoint(e, i, 2.09, 79.7924502089);
i = addMafPoint(e, i, 2.34, 110.961012317);
i = addMafPoint(e, i, 2.89, 208.198652496);
i = addMafPoint(e, i, 3.11, 260.1030585044);
i = addMafPoint(e, i, 3.54, 387.150427974);
i = addMafPoint(e, i, 3.81, 486.5363959026);
i = addMafPoint(e, i, 4, 566.628);
i = addMafPoint(e, i, 4.32, 722.3485684449);
i = addMafPoint(e, i, 4.65, 913.0847954331);
i = addMafPoint(e, i, 4.98, 1137.8746972553);
// I am copy-pasting from a spreadsheet, it works better if voltage goes first
i = addMafPointByVoltage(e, i, 0.29, 3.1768838175);
i = addMafPointByVoltage(e, i, 0.49, 3.6987752861);
i = addMafPointByVoltage(e, i, 0.72, 5.8013108424);
i = addMafPointByVoltage(e, i, 1, 11.1849);
i = addMafPointByVoltage(e, i, 1.37, 24.5646673361);
i = addMafPointByVoltage(e, i, 1.66, 41.453048941);
i = addMafPointByVoltage(e, i, 1.91, 61.5847903829);
i = addMafPointByVoltage(e, i, 2.09, 79.7924502089);
i = addMafPointByVoltage(e, i, 2.34, 110.961012317);
i = addMafPointByVoltage(e, i, 2.89, 208.198652496);
i = addMafPointByVoltage(e, i, 3.11, 260.1030585044);
i = addMafPointByVoltage(e, i, 3.54, 387.150427974);
i = addMafPointByVoltage(e, i, 3.81, 486.5363959026);
i = addMafPointByVoltage(e, i, 4, 566.628);
i = addMafPointByVoltage(e, i, 4.32, 722.3485684449);
i = addMafPointByVoltage(e, i, 4.65, 913.0847954331);
i = addMafPointByVoltage(e, i, 4.98, 1137.8746972553);
fillTheRest(e, i);
}