Skip to content

Commit

Permalink
RAM efficiency of VR crank trigger shapes #2182
Browse files Browse the repository at this point in the history
Audi OEM 5-cyl trigger pattern aka "Tri-Tach" https://rusefi.com/forum/viewtopic.php?f=5&t=1912
  • Loading branch information
rusefillc committed Jan 5, 2021
1 parent 43f37c6 commit 8c38664
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions firmware/controllers/trigger/decoders/trigger_structure.cpp
Expand Up @@ -186,6 +186,14 @@ extern bool printTriggerDebug;
void TriggerWaveform::calculateExpectedEventCounts(bool useOnlyRisingEdgeForTrigger) {
UNUSED(useOnlyRisingEdgeForTrigger);

if (!useOnlyRisingEdgeForTrigger) {
for (int i = 0;i<efi::size(expectedEventCount);i++) {
if (expectedEventCount[i] % 2 != 0) {
firmwareError(ERROR_TRIGGER_DRAMA, "Trigger: should be even %d %d", i, expectedEventCount[i]);
}
}
}

bool isSingleToothOnPrimaryChannel = useOnlyRisingEdgeForTrigger ? expectedEventCount[0] == 1 : expectedEventCount[0] == 2;
// todo: next step would be to set 'isSynchronizationNeeded' automatically based on the logic we have here
if (!shapeWithoutTdc && isSingleToothOnPrimaryChannel != !isSynchronizationNeeded) {
Expand Down

0 comments on commit 8c38664

Please sign in to comment.