From 3b9b53e31427da479975c00c03ce62964ca68d9d Mon Sep 17 00:00:00 2001 From: Andrey Date: Sat, 19 Mar 2022 17:57:20 -0400 Subject: [PATCH] Mitsubishi 3A92 Support - 3 cylinder #4011 --- firmware/controllers/core/state_sequence.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/core/state_sequence.cpp b/firmware/controllers/core/state_sequence.cpp index 7252e6520e..a0868bde54 100644 --- a/firmware/controllers/core/state_sequence.cpp +++ b/firmware/controllers/core/state_sequence.cpp @@ -10,8 +10,16 @@ #include "trigger_structure.h" void MultiChannelStateSequence::checkSwitchTimes(const float scale) const { + efiAssertVoid(CUSTOM_ERR_WAVE_1, phaseCount > 0, "StateSequence cannot be empty"); if (getSwitchTime(phaseCount - 1) != 1) { - firmwareError(CUSTOM_ERR_WAVE_1, "last switch time has to be 1/%f not %.2f/%f", +#if EFI_UNIT_TESTS + for (int index = 0;index < phaseCount;index ++) { + printf("switch time index=%d angle=%f\n", index, getSwitchTime(index)); + } +#endif // EFI_UNIT_TESTS + + firmwareError(CUSTOM_ERR_WAVE_1, "[count=%d] last switch time has to be 1/%f not %.2f/%f", + phaseCount, scale, getSwitchTime(phaseCount - 1), scale * getSwitchTime(phaseCount - 1)); return;