rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
trigger_renault.cpp
Go to the documentation of this file.
1#include "pch.h"
2#include "trigger_renault.h"
3#include "trigger_universal.h"
4
5// Renault F3R
8 int totalTeethCount = 60;
9
10 float engineCycle = FOUR_STROKE_ENGINE_CYCLE;
11 float toothWidth = 0.5;
12
13 float oneTooth = engineCycle / totalTeethCount;
14
15 int skipped = 3; // yes, from this perspective only three are skipped
16
17 // remaining 56 teeth while filtering four out
18 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, skipped, toothWidth, /*offset*/0, engineCycle,
19 NO_LEFT_FILTER, 719);
20
21#if EFI_UNIT_TEST
22 criticalAssertVoid(s->wave.phaseCount == (totalTeethCount - skipped) * 2 - 1, "Tooth count 60-3");
23#endif // EFI_UNIT_TEST
24
25 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 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/0, engineCycle,
30 specialPosition - 1, specialPosition - 1 + oneTooth);
31
32#if EFI_UNIT_TEST
33 criticalAssertVoid(s->wave.phaseCount == (totalTeethCount - skipped) * 2 + 1, "Tooth count 60-2-2");
34#endif // EFI_UNIT_TEST
35
37
41}
Trigger shape has all the fields needed to describe and decode trigger signal.
void initialize(operation_mode_e operationMode, SyncEdge syncEdge)
void setSecondTriggerSynchronizationGap(float syncRatio)
void setTriggerSynchronizationGap(float syncRatio)
void setThirdTriggerSynchronizationGap(float syncRatio)
MultiChannelStateSequenceWithData< PWM_PHASE_MAX_COUNT > wave
void addEvent(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
@ FOUR_STROKE_CRANK_SENSOR
void initialize60_2_2_Renault_F(TriggerWaveform *s)
void addSkippedToothTriggerEvents(TriggerWheel wheel, TriggerWaveform *s, int totalTeethCount, int skippedCount, float toothWidthPercentage, float offset, float engineCycle, float filterLeft, float filterRight)