diff --git a/firmware/controllers/algo/obd_error_codes.h b/firmware/controllers/algo/obd_error_codes.h index 5c76927fab..0c16c24ad7 100644 --- a/firmware/controllers/algo/obd_error_codes.h +++ b/firmware/controllers/algo/obd_error_codes.h @@ -2058,7 +2058,7 @@ typedef enum { CUSTOM_ERR_ZERO_CRANKING_FUEL = 6694, CUSTOM_ERR_6695 = 6695, CUSTOM_ERR_6696 = 6696, - CUSTOM_ERR_6697 = 6697, + CUSTOM_PWM_CYCLE_START = 6697, CUSTOM_ERR_ARRAY_IS_FULL = 6698, CUSTOM_ERR_ARRAY_REMOVE_ERROR = 6699, CUSTOM_ERR_INVALID_INPUT_ICU_PIN = 6700, @@ -2069,7 +2069,7 @@ typedef enum { CUSTOM_ERR_6703 = 6703, CUSTOM_ERR_BOTH_FRONTS_REQUIRED = 6704, CUSTOM_TLE8888 = 6705, - CUSTOM_ERR_6706 = 6706, + CUSTOM_KNOCK_WINDOW = 6706, CUSTOM_ERR_TIMER_TEST_CALLBACK_NOT_HAPPENED = 6707, CUSTOM_ERR_TIMER_TEST_CALLBACK_WRONG_TIME = 6708, CUSTOM_ERR_6709 = 6709, diff --git a/firmware/controllers/scheduling/pwm_generator_logic.cpp b/firmware/controllers/scheduling/pwm_generator_logic.cpp index 571afb4848..b0c6ed99bc 100644 --- a/firmware/controllers/scheduling/pwm_generator_logic.cpp +++ b/firmware/controllers/scheduling/pwm_generator_logic.cpp @@ -137,10 +137,15 @@ void PwmConfig::stop() { } void PwmConfig::handleCycleStart() { - efiAssertVoid(CUSTOM_ERR_6697, safe.phaseIndex == 0, "handleCycleStart"); - if (pwmCycleCallback != NULL) { - pwmCycleCallback(this); - } + if (safe.phaseIndex != 0) { + // https://github.com/rusefi/rusefi/issues/1030 + firmwareError(CUSTOM_PWM_CYCLE_START, "handleCycleStart %d", safe.phaseIndex); + return; + } + + if (pwmCycleCallback != NULL) { + pwmCycleCallback(this); + } efiAssertVoid(CUSTOM_ERR_6580, periodNt != 0, "period not initialized"); if (safe.periodNt != periodNt || safe.iteration == ITERATION_LIMIT) { /** diff --git a/firmware/hw_layer/hip9011.cpp b/firmware/hw_layer/hip9011.cpp index 35016527b2..f0dde59bde 100644 --- a/firmware/hw_layer/hip9011.cpp +++ b/firmware/hw_layer/hip9011.cpp @@ -255,13 +255,13 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index DECLARE int structIndex = getRevolutionCounter() % 2; // todo: schedule this based on closest trigger event, same as ignition works scheduleByAngle(&startTimer[structIndex], engineConfiguration->knockDetectionWindowStart, - (schfunc_t) &startIntegration, NULL PASS_ENGINE_PARAMETER_SUFFIX); + (schfunc_t) &startIntegration, NULL); #if EFI_PROD_CODE hipLastExecutionCount = lastExecutionCount; #endif /* EFI_PROD_CODE */ scheduleByAngle(&endTimer[structIndex], engineConfiguration->knockDetectionWindowEnd, (schfunc_t) &endIntegration, - NULL PASS_ENGINE_PARAMETER_SUFFIX); + NULL); engine->m.hipCbTime = getTimeNowLowerNt() - engine->m.beforeHipCb; }