only:ID2INDEX
This commit is contained in:
parent
98092c306f
commit
0bfdada528
|
@ -143,7 +143,7 @@ bool InjectionEvent::update() {
|
||||||
injectorIndex = 0;
|
injectorIndex = 0;
|
||||||
} else if (mode == IM_SEQUENTIAL || mode == IM_BATCH) {
|
} else if (mode == IM_SEQUENTIAL || mode == IM_BATCH) {
|
||||||
// Map order index -> cylinder index (firing order)
|
// Map order index -> cylinder index (firing order)
|
||||||
injectorIndex = getCylinderId(ownIndex) - 1;
|
injectorIndex = ID2INDEX(getCylinderId(ownIndex));
|
||||||
} else {
|
} else {
|
||||||
firmwareError(ObdCode::CUSTOM_OBD_UNEXPECTED_INJECTION_MODE, "Unexpected injection mode %d", mode);
|
firmwareError(ObdCode::CUSTOM_OBD_UNEXPECTED_INJECTION_MODE, "Unexpected injection mode %d", mode);
|
||||||
injectorIndex = 0;
|
injectorIndex = 0;
|
||||||
|
@ -159,7 +159,7 @@ bool InjectionEvent::update() {
|
||||||
// Each injector gets fired as a primary (the same as sequential), but also
|
// Each injector gets fired as a primary (the same as sequential), but also
|
||||||
// fires the injector 360 degrees later in the firing order.
|
// fires the injector 360 degrees later in the firing order.
|
||||||
int secondOrder = (ownIndex + (engineConfiguration->cylindersCount / 2)) % engineConfiguration->cylindersCount;
|
int secondOrder = (ownIndex + (engineConfiguration->cylindersCount / 2)) % engineConfiguration->cylindersCount;
|
||||||
int secondIndex = getCylinderId(secondOrder) - 1;
|
int secondIndex = ID2INDEX(getCylinderId(secondOrder));
|
||||||
secondOutput = &enginePins.injectors[secondIndex];
|
secondOutput = &enginePins.injectors[secondIndex];
|
||||||
} else {
|
} else {
|
||||||
secondOutput = nullptr;
|
secondOutput = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue