diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index e560987d08..8a262b781f 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -206,6 +206,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF } efiAssert(!cisnan(angle), "findAngle#3", false); + assertAngleRange(angle, "findAngle#a33"); TRIGGER_SHAPE(findTriggerPosition(&ev->injectionStart, angle PASS_ENGINE_PARAMETER_SUFFIX)); #if EFI_UNIT_TEST || defined(__DOXYGEN__) printf("registerInjectionEvent angle=%.2f trgIndex=%d inj %d\r\n", angle, ev->injectionStart.eventIndex, injectorIndex); diff --git a/firmware/controllers/trigger/spark_logic.cpp b/firmware/controllers/trigger/spark_logic.cpp index 9cac131dff..ca3f0c2151 100644 --- a/firmware/controllers/trigger/spark_logic.cpp +++ b/firmware/controllers/trigger/spark_logic.cpp @@ -172,9 +172,10 @@ static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventI * Spark event is often happening during a later trigger event timeframe * TODO: improve precision */ - efiAssertVoid(!cisnan(iEvent->advance), "findAngle#4"); - assertAngleRange(iEvent->advance, "findAngle#a5"); - TRIGGER_SHAPE(findTriggerPosition(&iEvent->sparkPosition, iEvent->advance PASS_ENGINE_PARAMETER_SUFFIX)); + float advance = iEvent->advance; + efiAssertVoid(!cisnan(advance), "findAngle#4"); + assertAngleRange(advance, "findAngle#a5"); + TRIGGER_SHAPE(findTriggerPosition(&iEvent->sparkPosition, advance PASS_ENGINE_PARAMETER_SUFFIX)); #if EFI_UNIT_TEST || defined(__DOXYGEN__) printf("spark dwell@ %d/%d spark@ %d/%d id=%d\r\n", iEvent->dwellPosition.eventIndex, (int)iEvent->dwellPosition.angleOffset,