#598 really strage error

This commit is contained in:
rusefi 2018-07-28 13:58:19 -04:00
parent ddedfe104e
commit e03314e4a5
1 changed files with 13 additions and 3 deletions

View File

@ -404,9 +404,19 @@ static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
*/ */
int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) { int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
const int foLength = getFiringOrderLength(PASS_ENGINE_PARAMETER_SIGNATURE); const int firingOrderLength = getFiringOrderLength(PASS_ENGINE_PARAMETER_SIGNATURE);
if (engineConfiguration->specs.cylindersCount != foLength) {
warning(CUSTOM_OBD_WRONG_FIRING_ORDER, "Wrong firing order %d/%d", engineConfiguration->specs.cylindersCount, foLength); if (index < 1 || index > INJECTION_PIN_COUNT) {
firmwareError(CUSTOM_ERR_6687, "fol %d", firingOrderLength);
return 1;
}
if (engineConfiguration->specs.cylindersCount != firingOrderLength) {
warning(CUSTOM_OBD_WRONG_FIRING_ORDER, "Wrong firing order %d/%d", engineConfiguration->specs.cylindersCount, firingOrderLength);
return 1;
}
if (index < 0 || index >= firingOrderLength) {
firmwareError(CUSTOM_ERR_6687, "index %d", index);
return 1; return 1;
} }