| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | /* | |||
| 2 | * honda_k_dbc.cpp | |||
| 3 | * | |||
| 4 | * @date Oct 2, 2021 | |||
| 5 | * @author Andrey Belomutskiy, (c) 2012-2021 | |||
| 6 | */ | |||
| 7 | ||||
| 8 | #include "honda_k_dbc.h" | |||
| 9 | #include "table_helper.h" | |||
| 10 | ||||
| 11 | #if HW_PROTEUS & EFI_PROD_CODE | |||
| 12 | #include "proteus_meta.h" | |||
| 13 | #endif // HW_PROTEUS | |||
| 14 | ||||
| 15 | 1 | void setHondaK() { | ||
| 16 | 1 | engineConfiguration->cylindersCount = 4; | ||
| 17 | 1 | engineConfiguration->displacement = 2.4; | ||
| 18 | 1 | engineConfiguration->firingOrder = FO_1_3_4_2; | ||
| 19 | 1 | engineConfiguration->engineSyncCam = SC_Exhaust_First; | ||
| 20 | 1 | engineConfiguration->trigger.type = trigger_type_e::TT_HONDA_K_CRANK_12_1; | ||
| 21 | 1 | engineConfiguration->camSyncOnSecondCrankRevolution = true; | ||
| 22 | 1 | int magic = 0; // note that offset and VVT are related | ||
| 23 | 1 | engineConfiguration->globalTriggerAngleOffset = 303 - magic; | ||
| 24 | ||||
| 25 | // VVT is here just single tooth? and we do not even use it!? | |||
| 26 | 1 | engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE; | ||
| 27 | // also known as 'CAM sync'? i am pretty confused at this point | |||
| 28 | 1 | engineConfiguration->vvtMode[1] = VVT_HONDA_K_EXHAUST; | ||
| 29 | 1 | engineConfiguration->vvtOffsets[0] = -21; | ||
| 30 | 1 | engineConfiguration->vvtOffsets[1] = 183 + magic; | ||
| 31 | ||||
| 32 | // set cranking_fuel 15 | |||
| 33 | 1 | setTable(config->crankingCycleBaseFuel, 75); | ||
| 34 | ||||
| 35 | 1 | engineConfiguration->map.sensor.type = MT_DENSO183; | ||
| 36 | // todo: quote some source? | |||
| 37 | 1 | engineConfiguration->injector.flow = 270; | ||
| 38 | 1 | engineConfiguration->injector.flow = 310; | ||
| 39 | 1 | engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure; | ||
| 40 | 1 | engineConfiguration->fuelReferencePressure = 350; // TODO: what is real value?! | ||
| 41 | ||||
| 42 | 1 | engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; | ||
| 43 | 1 | engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; | ||
| 44 | 1 | engineConfiguration->injectionMode = IM_SEQUENTIAL; | ||
| 45 | ||||
| 46 | 1 | setArrayValues(config->cltCrankingCorr, 70); | ||
| 47 | static const uint16_t defaultPostCrankinDurationBins[] = { | |||
| 48 | 0, 65, 100, 125, 150, 250 | |||
| 49 | }; | |||
| 50 | 1 | copyArray(config->postCrankingDurationBins, defaultPostCrankinDurationBins); | ||
| 51 | 1 | setTable(config->postCrankingFactor, 1.25f); | ||
| 52 | 1 | engineConfiguration->useRunningMathForCranking = true; | ||
| 53 | ||||
| 54 | 1 | strcpy(engineConfiguration->engineMake, ENGINE_MAKE_HONDA); | ||
| 55 | 1 | strcpy(engineConfiguration->engineCode, "K24"); | ||
| 56 | ||||
| 57 | 1 | engineConfiguration->tpsMin = 100; | ||
| 58 | 1 | engineConfiguration->tpsMax = 830; | ||
| 59 | ||||
| 60 | 1 | engineConfiguration->displayLogicLevelsInEngineSniffer = true; | ||
| 61 | ||||
| 62 | 1 | gppwm_channel *vtsControl = &engineConfiguration->gppwm[0]; | ||
| 63 | 1 | vtsControl->pwmFrequency = 0; | ||
| 64 | #if EFI_SIMULATOR | |||
| 65 | // simulator canned config XML toolset cares to see perfect empty memory region | |||
| 66 | memset(engineConfiguration->gpPwmNote[0], 0, sizeof(gppwm_note_t)); | |||
| 67 | #endif | |||
| 68 | 1 | strcpy(engineConfiguration->gpPwmNote[0], "VTS"); | ||
| 69 | ||||
| 70 | /** | |||
| 71 | * K24A4 engine | |||
| 72 | * HONDA_K | |||
| 73 | */ | |||
| 74 | ||||
| 75 | #if HW_PROTEUS & EFI_PROD_CODE | |||
| 76 | strcpy(engineConfiguration->vehicleName, "test"); | |||
| 77 | // engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_2; // crank | |||
| 78 | // engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_4; // intake | |||
| 79 | // engineConfiguration->camInputs[1 * CAMS_PER_BANK] = PROTEUS_DIGITAL_1; // exhaust | |||
| 80 | ||||
| 81 | engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_1; // exhaust | |||
| 82 | engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_4; // intake | |||
| 83 | // inverted | |||
| 84 | // offset -41 | |||
| 85 | ||||
| 86 | ||||
| 87 | engineConfiguration->injectionPins[0] = Gpio::PROTEUS_LS_8; | |||
| 88 | engineConfiguration->injectionPins[1] = Gpio::PROTEUS_LS_7; | |||
| 89 | engineConfiguration->injectionPins[2] = Gpio::PROTEUS_LS_6; | |||
| 90 | engineConfiguration->injectionPins[3] = Gpio::PROTEUS_LS_5; | |||
| 91 | ||||
| 92 | vtsControl->pin = Gpio::PROTEUS_HS_1; | |||
| 93 | engineConfiguration->vvtPins[0] = Gpio::PROTEUS_HS_2; | |||
| 94 | ||||
| 95 | engineConfiguration->malfunctionIndicatorPin = Gpio::PROTEUS_LS_10; | |||
| 96 | engineConfiguration->idle.solenoidPin = Gpio::PROTEUS_LS_15; | |||
| 97 | engineConfiguration->fanPin = Gpio::PROTEUS_LS_1; | |||
| 98 | ||||
| 99 | engineConfiguration->iat.adcChannel = PROTEUS_IN_ANALOG_TEMP_1; | |||
| 100 | engineConfiguration->clt.adcChannel = PROTEUS_IN_ANALOG_TEMP_2; | |||
| 101 | engineConfiguration->tps1_1AdcChannel = PROTEUS_IN_ANALOG_VOLT_3; | |||
| 102 | engineConfiguration->map.sensor.hwChannel = PROTEUS_IN_ANALOG_VOLT_6; | |||
| 103 | engineConfiguration->fanPin = Gpio::Unassigned; | |||
| 104 | ||||
| 105 | engineConfiguration->mainRelayPin = Gpio::PROTEUS_LS_9; | |||
| 106 | engineConfiguration->fuelPumpPin = Gpio::PROTEUS_LS_11; | |||
| 107 | ||||
| 108 | #endif // HW_PROTEUS | |||
| 109 | 1 | } | ||
| 110 | ||||
| 111 | ✗ | void setProteusHondaOBD2A() { | ||
| 112 | ||||
| 113 | ✗ | } | ||
| 114 |