better startup handling

This commit is contained in:
rusefi 2017-04-13 10:43:27 -04:00
parent 060f07f388
commit fa66cc1a2a
3 changed files with 7 additions and 7 deletions

View File

@ -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;
}

View File

@ -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,

View File

@ -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();