diff --git a/firmware/controllers/bench_test.cpp b/firmware/controllers/bench_test.cpp index 7fc267fd02..f22311ba9b 100644 --- a/firmware/controllers/bench_test.cpp +++ b/firmware/controllers/bench_test.cpp @@ -136,7 +136,11 @@ static void pinbench(float p_ontimeMs, float p_offtimeMs, int iterations, { onTimeMs = p_ontimeMs; offTimeMs = p_offtimeMs; +#if EFI_SIMULATOR count = maxI(2, iterations); +#else + count = iterations; +#endif // EFI_SIMULATOR pinX = pinParam; // let's signal bench thread to wake up isBenchTestPending = true; diff --git a/java_console/autotest/src/main/java/com/rusefi/simulator/SimulatorFunctionalTest.java b/java_console/autotest/src/main/java/com/rusefi/simulator/SimulatorFunctionalTest.java index e408c2579b..23ffa8cc06 100644 --- a/java_console/autotest/src/main/java/com/rusefi/simulator/SimulatorFunctionalTest.java +++ b/java_console/autotest/src/main/java/com/rusefi/simulator/SimulatorFunctionalTest.java @@ -184,6 +184,8 @@ private void testOutputPin(bench_mode_e pinId, int stateToggleTimeMs) throws Int executeIoControlCommand(bench_test_io_control_e.CAN_BENCH_END_PIN_TEST, new bench_test_packet_ids_e[] { }, (byte)pinId.ordinal()); + // this check assumes that simulator makes 2 iterations for each pin + // (this magic is needed because we don't know the previous pin state before starting the test) if (pinToggleCounter < defaultPinToggleCounter + 3 || pinToggleCounter > defaultPinToggleCounter + 4) { throw new IllegalStateException("Unexpected pin toggle counter: before=" + defaultPinToggleCounter + " after=" + pinToggleCounter);