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