fixed #363
This commit is contained in:
parent
bf61b0f7a6
commit
daba9c9125
|
@ -395,7 +395,7 @@ void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_
|
|||
void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
s->setTriggerSynchronizationGap(0.72);
|
||||
s->setTriggerSynchronizationGap(0.8227);
|
||||
|
||||
s->useRiseEdge = false;
|
||||
|
||||
|
|
|
@ -60,25 +60,28 @@ void TriggerStimulatorHelper::nextStep(TriggerState *state, TriggerShape * shape
|
|||
if (primaryWheelState != newPrimaryWheelState) {
|
||||
primaryWheelState = newPrimaryWheelState;
|
||||
trigger_event_e s = primaryWheelState ? SHAFT_PRIMARY_RISING : SHAFT_PRIMARY_FALLING;
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
if (isUsefulSignal(s, engineConfiguration))
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
|
||||
if (secondaryWheelState != newSecondaryWheelState) {
|
||||
secondaryWheelState = newSecondaryWheelState;
|
||||
trigger_event_e s = secondaryWheelState ? SHAFT_SECONDARY_RISING : SHAFT_SECONDARY_FALLING;
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
if (isUsefulSignal(s, engineConfiguration))
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
|
||||
if (thirdWheelState != new3rdWheelState) {
|
||||
thirdWheelState = new3rdWheelState;
|
||||
trigger_event_e s = thirdWheelState ? SHAFT_3RD_RISING : SHAFT_3RD_FALLING;
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
if (isUsefulSignal(s, engineConfiguration))
|
||||
state->decodeTriggerEvent(s, time PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
}
|
||||
|
||||
void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(const uint32_t syncIndex, TriggerState *state, TriggerShape * shape,
|
||||
trigger_config_s const*triggerConfig DECLARE_ENGINE_PARAMETER_S) {
|
||||
int startIndex = engineConfiguration->useOnlyRisingEdgeForTrigger ? syncIndex + 2 : syncIndex + 1;
|
||||
int startIndex = syncIndex + 1;
|
||||
|
||||
for (uint32_t i = startIndex; i <= syncIndex + 2 * shape->getSize(); i++) {
|
||||
nextStep(state, shape, i, triggerConfig PASS_ENGINE_PARAMETER);
|
||||
|
|
|
@ -58,10 +58,10 @@ static int getTriggerZeroEventIndex(engine_type_e engineType) {
|
|||
}
|
||||
|
||||
static void testDodgeNeonDecoder(void) {
|
||||
printf("*************************************************** testDodgeNeonDecoder\r\n");
|
||||
printf("*************************************************** testDodgeNeonDecoder95\r\n");
|
||||
initTriggerDecoder();
|
||||
|
||||
assertEqualsM("trigger zero index", 8, getTriggerZeroEventIndex(DODGE_NEON_1995));
|
||||
assertEqualsM("DODGE_NEON_1995: trigger zero index", 8, getTriggerZeroEventIndex(DODGE_NEON_1995));
|
||||
|
||||
EngineTestHelper eth(DODGE_NEON_1995);
|
||||
EXPAND_EngineTestHelper;
|
||||
|
@ -478,21 +478,21 @@ void testTriggerDecoder(void) {
|
|||
assertEquals(s->wave.switchTimes[3], 1);
|
||||
|
||||
testDodgeNeonDecoder();
|
||||
testTriggerDecoder2("dodge neon", DODGE_NEON_1995, 8, 0.4931, 0.2070);
|
||||
testTriggerDecoder2("Dodge Neon 1995", DODGE_NEON_1995, 8, 0.4931, 0.2070);
|
||||
|
||||
testFordAspire();
|
||||
testTriggerDecoder2("ford aspire", FORD_ASPIRE_1996, 4, 0.5000, 0.3841);
|
||||
testTriggerDecoder2("ford aspire", FORD_ASPIRE_1996, 4, 0.0000, 0.5);
|
||||
|
||||
testTriggerDecoder2("dodge ram", DODGE_RAM, 16, 0.5000, 0.06);
|
||||
|
||||
//testTriggerDecoder2("bmw", BMW_E34, 0, 0.9750, 0.5167);
|
||||
testTriggerDecoder2("bmw", BMW_E34, 0, 0.4833, 0.0);
|
||||
testTriggerDecoder2("bmw", BMW_E34, 0, 0.4667, 0.0);
|
||||
|
||||
test1995FordInline6TriggerDecoder();
|
||||
testTriggerDecoder2("Miata NB", MAZDA_MIATA_NB1, 12, 0.0833, 0.0444);
|
||||
|
||||
testTriggerDecoder2("Civic 4/0 both", TEST_CIVIC_4_0_BOTH, 0, 0.5000, 0.0);
|
||||
// testTriggerDecoder2("Civic 4/0 rise", TEST_CIVIC_4_0_RISE, 0, 0.0000, 0.0);
|
||||
testTriggerDecoder2("Civic 4/0 rise", TEST_CIVIC_4_0_RISE, 0, 0.5000, 0.0);
|
||||
|
||||
testTriggerDecoder2("test engine", TEST_ENGINE, 0, 0.7500, 0.2500);
|
||||
testTriggerDecoder2("testGY6_139QMB", GY6_139QMB, 0, 0.4375, 0.0);
|
||||
|
|
Loading…
Reference in New Issue