| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | /* | |||
| 2 | * m111.cpp | |||
| 3 | * | |||
| 4 | * @date Dec 14, 2020 | |||
| 5 | * @author Andrey Belomutskiy, (c) 2012-2020 | |||
| 6 | */ | |||
| 7 | ||||
| 8 | #include "engine_configuration.h" | |||
| 9 | #include "m111.h" | |||
| 10 | #include "thermistors.h" | |||
| 11 | #include "defaults.h" | |||
| 12 | ||||
| 13 | #if HW_PROTEUS | |||
| 14 | #include "proteus_meta.h" | |||
| 15 | #endif // HW_PROTEUS | |||
| 16 | ||||
| 17 | #if HW_MICRO_RUSEFI | |||
| 18 | #include "mre_meta.h" | |||
| 19 | #endif // HW_MICRO_RUSEFI | |||
| 20 | ||||
| 21 | ✗ | void setMercedesM111EngineConfiguration() { | ||
| 22 | ✗ | engineConfiguration->cylindersCount = 4; | ||
| 23 | ✗ | engineConfiguration->firingOrder = FO_1_3_4_2; | ||
| 24 | ✗ | engineConfiguration->displacement = 2.295f; | ||
| 25 | ✗ | engineConfiguration->cylinderBore = 89.9; | ||
| 26 | ✗ | config->dynoCarCarMassKg = 1250; | ||
| 27 | ✗ | engineConfiguration->injector.flow = 196; | ||
| 28 | ✗ | engineConfiguration->enableCanVss = true; | ||
| 29 | ✗ | engineConfiguration->canVssNbcType = W202; | ||
| 30 | ✗ | engineConfiguration->canNbcType = CAN_BUS_W202_C180; | ||
| 31 | ||||
| 32 | #if HW_HELLEN | |||
| 33 | ✗ | engineConfiguration->enableSoftwareKnock = true; | ||
| 34 | #endif | |||
| 35 | ||||
| 36 | ✗ | engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; | ||
| 37 | ✗ | engineConfiguration->crankingInjectionMode = IM_SEQUENTIAL; | ||
| 38 | ✗ | engineConfiguration->injectionMode = IM_SEQUENTIAL; | ||
| 39 | ||||
| 40 | ✗ | strcpy(engineConfiguration->engineMake, ENGINE_MAKE_MERCEDES); | ||
| 41 | ✗ | strcpy(engineConfiguration->engineCode, "M111"); | ||
| 42 | ||||
| 43 | ✗ | engineConfiguration->vvtMode[0] = VVT_SINGLE_TOOTH; | ||
| 44 | ✗ | engineConfiguration->camSyncOnSecondCrankRevolution = true; | ||
| 45 | ✗ | engineConfiguration->globalTriggerAngleOffset = 109; // please use a timing light? | ||
| 46 | ||||
| 47 | // todo: i wonder if we have less custom curve for same sensor? | |||
| 48 | ✗ | setAtSensor(&engineConfiguration->iat, /*temp low*/0, 7400, /*temp mid*/22, 2180, /*temp high*/ 100, 180); | ||
| 49 | // todo: i wonder if these custom IAT and CLT curves are effectively same? | |||
| 50 | ✗ | setAtSensor(&engineConfiguration->clt, /*temp low*/0, 5750, /*temp mid*/30, 1750, /*temp high*/ 50, 750); | ||
| 51 | ||||
| 52 | ✗ | setCustomMap(/*lowValue*/ 20, 0.3, 250, 4.65); | ||
| 53 | ||||
| 54 | ✗ | engineConfiguration->idle.solenoidPin = Gpio::Unassigned; | ||
| 55 | ✗ | engineConfiguration->etb.pFactor = 5.12; | ||
| 56 | ✗ | engineConfiguration->etb.iFactor = 47; | ||
| 57 | ✗ | engineConfiguration->etb.dFactor = 0.088; | ||
| 58 | ✗ | engineConfiguration->etb.offset = 0; | ||
| 59 | ||||
| 60 | ✗ | strcpy(engineConfiguration->gpPwmNote[0], "SC Bypass"); | ||
| 61 | #if HW_MICRO_RUSEFI && EFI_PROD_CODE | |||
| 62 | gppwm_channel *scBypass = &engineConfiguration->gppwm[0]; | |||
| 63 | scBypass->pin = MRE_GPOUT_3; | |||
| 64 | #endif // HW_MICRO_RUSEFI | |||
| 65 | ||||
| 66 | ✗ | strcpy(engineConfiguration->gpPwmNote[1], "SC Clutch"); | ||
| 67 | #if HW_MICRO_RUSEFI && EFI_PROD_CODE | |||
| 68 | gppwm_channel *scClutch = &engineConfiguration->gppwm[1]; | |||
| 69 | scClutch->pin = MRE_LS_2; | |||
| 70 | engineConfiguration->vvtPins[0] = MRE_LS_1; | |||
| 71 | ||||
| 72 | engineConfiguration->fuelPumpPin = MRE_GPOUT_1; // more or less MRE default | |||
| 73 | engineConfiguration->fanPin = MRE_GPOUT_2; // more or less MRE default | |||
| 74 | setPPSInputs(MRE_IN_PPS, MRE_IN_PPS2); | |||
| 75 | setTPS1Inputs(MRE_IN_TPS, MRE_IN_TPS2); | |||
| 76 | ||||
| 77 | engineConfiguration->lowPressureFuel.hwChannel = MRE_IN_ANALOG_VOLT_4; | |||
| 78 | // assumes R30 is populated | |||
| 79 | engineConfiguration->boostControlPin = MRE_AV9_REUSE; | |||
| 80 | #endif // HW_MICRO_RUSEFI | |||
| 81 | // note how these numbers are very flipped hyundai154 defaults? | |||
| 82 | ✗ | setTPS1Calibration(891, 69, 98, 926); | ||
| 83 | // honda cable position sensor | |||
| 84 | ✗ | setPPSCalibration(0.38, 4.77, 4.64, 2.47); | ||
| 85 | ||||
| 86 | #if HW_PROTEUS && EFI_PROD_CODE | |||
| 87 | engineConfiguration->triggerInputPins[0] = PROTEUS_VR_1; | |||
| 88 | engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_2; | |||
| 89 | ||||
| 90 | setProteusEtbIO(); | |||
| 91 | #endif // HW_PROTEUS | |||
| 92 | ✗ | } | ||
| 93 |