2019-10-07 20:12:29 -07:00
|
|
|
/**
|
|
|
|
* @file test_one_cylinder_logic.cpp
|
2020-01-07 21:02:40 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2019-10-07 20:12:29 -07:00
|
|
|
*/
|
|
|
|
|
2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
2019-10-07 20:12:29 -07:00
|
|
|
#include "spark_logic.h"
|
|
|
|
|
|
|
|
TEST(issues, issueOneCylinderSpecialCase968) {
|
|
|
|
WITH_ENGINE_TEST_HELPER(GY6_139QMB);
|
2021-06-24 22:31:53 -07:00
|
|
|
ENGINE(tdcMarkEnabled) = false;
|
2019-10-07 20:12:29 -07:00
|
|
|
// set injection_mode 1
|
|
|
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
|
|
|
|
|
|
|
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
|
|
|
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
|
|
|
|
|
|
|
eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX);
|
|
|
|
|
|
|
|
ASSERT_EQ( 0, engine->executor.size()) << "start";
|
|
|
|
|
|
|
|
eth.fireTriggerEvents2(/* count */ 3, 50 /* ms */);
|
|
|
|
ASSERT_EQ( 0, GET_RPM()) << "RPM";
|
|
|
|
ASSERT_EQ( 0, engine->executor.size()) << "first revolution(s)";
|
|
|
|
|
|
|
|
eth.fireTriggerEvents2(/* count */ 1, 50 /* ms */);
|
|
|
|
|
|
|
|
ASSERT_EQ( 2, engine->executor.size()) << "first revolution(s)";
|
2021-06-02 02:02:52 -07:00
|
|
|
eth.assertEvent5("spark up#0", 0, (void*)turnSparkPinHigh, -45167);
|
|
|
|
eth.assertEvent5("spark down#0", 1, (void*)fireSparkAndPrepareNextSchedule, -39167);
|
2019-10-07 20:12:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
eth.fireTriggerEvents2(/* count */ 1, 50 /* ms */);
|
|
|
|
ASSERT_EQ( 4, engine->executor.size()) << "first revolution(s)";
|
|
|
|
}
|