only:Config compatibility

This commit is contained in:
rusefillc 2024-10-05 09:33:46 -04:00
parent 5852e7c8d4
commit 9fe6cd5760
1 changed files with 7 additions and 8 deletions

View File

@ -28,11 +28,11 @@ mass_t FuelComputerBase::getCycleFuel(mass_t airmass, float rpm, float load) {
float FuelComputer::getStoichiometricRatio() const {
float primary = engineConfiguration->stoichRatioPrimary;
// Config compatibility: this field may be zero on ECUs with old defaults
if (primary < 5) {
// todo: fatal in July of 2023
// 14.7 = E0 gasoline AFR
engineConfiguration->stoichRatioPrimary = primary = STOICH_RATIO;
// Config compatibility: this field may be zero on ECUs with very old defaults
criticalError("Please set stoichRatioPrimary");
return 0;
}
// Without an ethanol/flex sensor, return primary configured stoich ratio
@ -42,11 +42,10 @@ float FuelComputer::getStoichiometricRatio() const {
float secondary = engineConfiguration->stoichRatioSecondary;
// Config compatibility: this field may be zero on ECUs with old defaults
if (secondary < 5) {
// 9.0 = E100 ethanol AFR
// todo: fatal in July of 2023
engineConfiguration->stoichRatioSecondary = secondary = 9.0f;
// Config compatibility: this field may be zero on ECUs with very old defaults
criticalError("Please set stoichRatioSecondary");
return 0;
}
auto flex = Sensor::get(SensorType::FuelEthanolPercent);