auto-sync

This commit is contained in:
rusEfi 2016-11-08 22:02:47 -05:00
parent 6ff1f2360a
commit 489e9d8c58
2 changed files with 15 additions and 3 deletions

View File

@ -259,7 +259,13 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
enginePins.triggerDecoderErrorPin.setValue(isDecodingError); enginePins.triggerDecoderErrorPin.setValue(isDecodingError);
if (isDecodingError) { if (isDecodingError) {
warning(CUSTOM_SYNC_ERROR_2, "trigger not happy"); warning(CUSTOM_SYNC_ERROR_2, "trigger not happy current %d/%d/%d expected %d/%d/%d",
currentCycle.eventCount[0],
currentCycle.eventCount[1],
currentCycle.eventCount[2],
TRIGGER_SHAPE(expectedEventCount[0]),
TRIGGER_SHAPE(expectedEventCount[1]),
TRIGGER_SHAPE(expectedEventCount[2]));
lastDecodingErrorTime = getTimeNowNt(); lastDecodingErrorTime = getTimeNowNt();
someSortOfTriggerError = true; someSortOfTriggerError = true;

View File

@ -1241,7 +1241,7 @@ void testMissedSpark299(void) {
EngineTestHelper eth(TEST_ENGINE); EngineTestHelper eth(TEST_ENGINE);
EXPAND_EngineTestHelper EXPAND_EngineTestHelper
engineConfiguration->ignitionMode = IM_WASTED_SPARK; engineConfiguration->ignitionMode = IM_WASTED_SPARK;
engineConfiguration->useOnlyRisingEdgeForTrigger = true; engineConfiguration->useOnlyRisingEdgeForTrigger = false;
setTestBug299small(&eth); setTestBug299small(&eth);
engineConfiguration->isIgnitionEnabled = true; engineConfiguration->isIgnitionEnabled = true;
engineConfiguration->isInjectionEnabled = false; engineConfiguration->isInjectionEnabled = false;
@ -1262,7 +1262,7 @@ void testMissedSpark299(void) {
printf("*************************************************** testMissedSpark299 start\r\n"); printf("*************************************************** testMissedSpark299 start\r\n");
assertEquals(6000, eth.engine.rpmCalculator.rpmValue); assertEquals(3000, eth.engine.rpmCalculator.rpmValue);
setWholeTimingTable(3 PASS_ENGINE_PARAMETER); setWholeTimingTable(3 PASS_ENGINE_PARAMETER);
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F); eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
@ -1282,10 +1282,16 @@ void testMissedSpark299(void) {
timeNow += MS2US(20); timeNow += MS2US(20);
eth.firePrimaryTriggerRise(); eth.firePrimaryTriggerRise();
schedulingQueue.executeAll(timeNow); schedulingQueue.executeAll(timeNow);
// timeNow += MS2US(20);
// eth.firePrimaryTriggerFall();
// schedulingQueue.executeAll(timeNow);
timeNow += MS2US(20); timeNow += MS2US(20);
eth.firePrimaryTriggerRise(); eth.firePrimaryTriggerRise();
schedulingQueue.executeAll(timeNow); schedulingQueue.executeAll(timeNow);
// timeNow += MS2US(20);
// eth.firePrimaryTriggerFall();
// schedulingQueue.executeAll(timeNow);
assertEqualsM("warningCounter#1", 8, warningCounter); assertEqualsM("warningCounter#1", 8, warningCounter);
} }