/** * @brief Returns engine load according to selected engine_load_mode * */ float getEngineLoadT(Engine *engine) { efiAssert(engine!=NULL, "engine 2NULL", NAN); engine_configuration_s *engineConfiguration = engine->engineConfiguration; efiAssert(engineConfiguration!=NULL, "engineConfiguration 2NULL", NAN); switch (engineConfiguration->algorithm) { case LM_MAF: return getMafT(engineConfiguration); case LM_SPEED_DENSITY: // SD engine load is used for timing lookup but not for fuel calculation case LM_MAP: return getMap(); case LM_TPS: return getTPS(); default: firmwareError("Unexpected engine load parameter: %d", engineConfiguration->algorithm); return -1; } }
/** * @brief Returns engine load according to selected engine_load_mode * */ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_F) { efiAssert(engine!=NULL, "engine 2NULL", NAN); efiAssert(engineConfiguration!=NULL, "engineConfiguration 2NULL", NAN); switch (engineConfiguration->algorithm) { case LM_PLAIN_MAF: if (!hasMafSensor(PASS_ENGINE_PARAMETER_F)) { warning(OBD_PCM_Processor_Fault, "MAF sensor needed for current fuel algorithm"); return NAN; } return getMafT(engineConfiguration); case LM_SPEED_DENSITY: // SD engine load is used for timing lookup but not for fuel calculation case LM_MAP: return getMap(); case LM_ALPHA_N: return getTPS(PASS_ENGINE_PARAMETER_F); case LM_REAL_MAF: { return getRealMaf(PASS_ENGINE_PARAMETER_F); } default: warning(OBD_PCM_Processor_Fault, "Unexpected engine load parameter: %d", engineConfiguration->algorithm); return -1; } }
/** * @return MAF sensor voltage */ float getMaf(DECLARE_ENGINE_PARAMETER_F) { return getMafT(engineConfiguration); }
float getMaf(void) { return getMafT(engineConfiguration); }