diff --git a/firmware/controllers/algo/obd_error_codes.h b/firmware/controllers/algo/obd_error_codes.h index 076df751f0..7af3554e4f 100644 --- a/firmware/controllers/algo/obd_error_codes.h +++ b/firmware/controllers/algo/obd_error_codes.h @@ -1697,8 +1697,8 @@ typedef enum { CUSTOM_OBD_28 = 6028, CUSTOM_OBD_29 = 6029, - CUSTOM_OBD_30 = 6030, - CUSTOM_OBD_31 = 6031, + CUSTOM_OBD_NAN_INJECTION = 6030, + CUSTOM_OBD_NEG_INJECTION = 6031, CUSTOM_OBD_32 = 6032, CUSTOM_OBD_33 = 6033, CUSTOM_OBD_34 = 6034, diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 1aad9cf84f..7974b74536 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -106,15 +106,15 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedF * wetting coefficient works the same way for any injection mode, or is something * x2 or /2? */ - floatms_t injectionDuration = ENGINE(wallFuel).adjust(event->injectorIndex, ENGINE(fuelMs) PASS_ENGINE_PARAMETER); + const floatms_t injectionDuration = ENGINE(wallFuel).adjust(event->injectorIndex, ENGINE(fuelMs) PASS_ENGINE_PARAMETER); ENGINE(actualLastInjection) = injectionDuration; if (cisnan(injectionDuration)) { - warning(CUSTOM_OBD_30, "NaN injection pulse"); + warning(CUSTOM_OBD_NAN_INJECTION, "NaN injection pulse"); return; } if (injectionDuration < 0) { - warning(CUSTOM_OBD_31, "Negative injection pulse %f", injectionDuration); + warning(CUSTOM_OBD_NEG_INJECTION, "Negative injection pulse %f", injectionDuration); return; } @@ -126,14 +126,6 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedF OutputSignal *signal = &ENGINE(engineConfiguration2)->fuelActuators[eventIndex]; if (event->isSimultanious) { - if (injectionDuration < 0) { - firmwareError("duration cannot be negative: %d", injectionDuration); - return; - } - if (cisnan(injectionDuration)) { - firmwareError("NaN in scheduleOutput", injectionDuration); - return; - } /** * this is pretty much copy-paste of 'scheduleOutput' * 'scheduleOutput' is currently only used for injection, so maybe it should be