diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index eac7c975c6..028593f58a 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -220,13 +220,13 @@ float getIatFuelCorrection(float iat DECLARE_ENGINE_PARAMETER_S) { floatms_t getBaseTableFuel(int rpm, float engineLoad) { if (cisnan(engineLoad)) { warning(CUSTOM_NAN_ENGINE_LOAD_2, "NaN engine load"); - return NAN; + return 0; } floatms_t result = fuelMap.getValue(rpm, engineLoad); if (cisnan(result)) { // result could be NaN in case of invalid table, like during initialization result = 0; - warning(CUSTOM_ERR_6138, "baseFuel table not ready"); + warning(CUSTOM_ERR_FUEL_TABLE_NOT_READY, "baseFuel table not ready"); } return result; } diff --git a/firmware/controllers/algo/obd_error_codes.h b/firmware/controllers/algo/obd_error_codes.h index b17f7a9453..1449c5c6d1 100644 --- a/firmware/controllers/algo/obd_error_codes.h +++ b/firmware/controllers/algo/obd_error_codes.h @@ -1837,10 +1837,10 @@ typedef enum { CUSTOM_ERR_PIN_ALREADY_USED_1 = 6133, CUSTOM_ERR_PIN_ALREADY_USED_2 = 6134, CUSTOM_ERR_ICU_STATE = 6135, - CUSTOM_ERR_6136 = 6136, + CUSTOM_ERR_TCHARGE_NOT_READY = 6136, CUSTOM_ERR_6137 = 6137, - CUSTOM_ERR_6138 = 6138, - CUSTOM_ERR_6139 = 6139, + CUSTOM_ERR_FUEL_TABLE_NOT_READY = 6138, + CUSTOM_ERR_TCHARGE_NOT_READY2 = 6139, CUSTOM_ERR_6140 = 6140, CUSTOM_ERR_FLASH_CRC_FAILED = 6141, diff --git a/firmware/controllers/math/speed_density.cpp b/firmware/controllers/math/speed_density.cpp index eed074e28b..261dc02d90 100644 --- a/firmware/controllers/math/speed_density.cpp +++ b/firmware/controllers/math/speed_density.cpp @@ -39,7 +39,7 @@ float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_EN if (cisnan(Tcharge)) { // we can probably end up here while resetting engine state - interpolation would fail - warning(CUSTOM_ERR_6136, "getTCharge NaN"); + warning(CUSTOM_ERR_TCHARGE_NOT_READY, "getTCharge NaN"); return coolantTemp; } @@ -87,7 +87,7 @@ floatms_t getSpeedDensityFuel(DECLARE_ENGINE_PARAMETER_F) { */ float tChargeK = ENGINE(engineState.tChargeK); if (cisnan(tChargeK)) { - warning(CUSTOM_ERR_6139, "tChargeK not ready"); // this would happen before we have CLT reading for example + warning(CUSTOM_ERR_TCHARGE_NOT_READY2, "tChargeK not ready"); // this would happen before we have CLT reading for example return 0; } float map = getMap();