6.1 Hemi V8 decoder #2010

This commit is contained in:
rusefillc 2020-12-04 16:03:27 -05:00
parent e730c2c0b1
commit 2524b7b8c2
2 changed files with 6 additions and 3 deletions

View File

@ -69,7 +69,7 @@ class TriggerFormDetails;
class TriggerConfiguration;
// https://github.com/rusefi/rusefi/issues/2010 shows the corner case wheel with huge depth requirement
#define GAP_TRACKING_LENGTH 6
#define GAP_TRACKING_LENGTH 18
/**
* @brief Trigger shape has all the fields needed to describe and decode trigger signal.

View File

@ -116,16 +116,19 @@ void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(
TriggerWaveform& shape
) {
// todo: is anything limiting this TEST_REVOLUTIONS? why does value '8' not work for example?
#define TEST_REVOLUTIONS 6
/**
* let's feed two more cycles to validate shape definition
*/
for (uint32_t i = syncIndex + 1; i <= syncIndex + GAP_TRACKING_LENGTH * shape.getSize(); i++) {
for (uint32_t i = syncIndex + 1; i <= syncIndex + TEST_REVOLUTIONS * shape.getSize(); i++) {
feedSimulatedEvent(triggerCycleCallback,
triggerConfiguration,
state, shape, i);
}
int revolutionCounter = state.getTotalRevolutionCounter();
if (revolutionCounter != GAP_TRACKING_LENGTH + 1) {
if (revolutionCounter != TEST_REVOLUTIONS + 1) {
warning(CUSTOM_OBD_TRIGGER_WAVEFORM, "sync failed/wrong gap parameters trigger=%s revolutionCounter=%d", getTrigger_type_e(triggerConfiguration.TriggerType), revolutionCounter);
shape.setShapeDefinitionError(true);
return;