LCOV - code coverage report
Current view: top level - firmware/controllers/trigger/decoders - trigger_renault.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 17 17 100.0 %
Date: 2024-05-05 20:50:36 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "pch.h"
       2             : #include "trigger_renault.h"
       3             : #include "trigger_universal.h"
       4             : 
       5             : // Renault F3R
       6           1 : void initialize60_2_2_Renault_F(TriggerWaveform *s) {
       7           1 :         s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::RiseOnly);
       8           1 :         int totalTeethCount = 60;
       9             : 
      10           1 :         float engineCycle = FOUR_STROKE_ENGINE_CYCLE;
      11           1 :     float toothWidth = 0.5;
      12             : 
      13           1 :     float oneTooth = engineCycle / totalTeethCount;
      14             : 
      15           1 :     int skipped = 3; // yes, from this perspective only three are skipped
      16             : 
      17             :     // remaining 56 teeth while filtering four out
      18           1 :     addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, skipped, toothWidth, /*offset*/0, engineCycle,
      19             :                 NO_LEFT_FILTER, 719);
      20             : 
      21             : #if EFI_UNIT_TEST
      22           1 :     criticalAssertVoid(s->wave.phaseCount == (totalTeethCount - skipped) * 2 - 1, "Tooth count 60-3");
      23             : #endif // EFI_UNIT_TEST
      24             : 
      25           1 :     float specialPosition = 58 * oneTooth;
      26             : 
      27             :     // single twice-the-width tooth
      28             :     // we have that weird API where last FALL is added as 720, all while we do not really care about FALL fronts :(
      29           1 :     addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/0, engineCycle,
      30           1 :                 specialPosition - 1, specialPosition - 1 + oneTooth);
      31             : 
      32             : #if EFI_UNIT_TEST
      33           1 :     criticalAssertVoid(s->wave.phaseCount == (totalTeethCount - skipped) * 2 + 1, "Tooth count 60-2-2");
      34             : #endif // EFI_UNIT_TEST
      35             : 
      36           1 :     s->addEvent(1, TriggerValue::FALL, TriggerWheel::T_PRIMARY);
      37             : 
      38           1 :         s->setTriggerSynchronizationGap(0.5);
      39           1 :         s->setSecondTriggerSynchronizationGap(1);
      40           1 :         s->setThirdTriggerSynchronizationGap(2);
      41             : }

Generated by: LCOV version 1.14