GCC Code Coverage Report


Directory: ./
File: firmware/controllers/trigger/decoders/trigger_suzuki.cpp
Date: 2025-10-03 00:57:22
Coverage Exec Excl Total
Lines: 100.0% 35 0 35
Functions: 100.0% 2 0 2
Branches: -% 0 0 0
Decisions: -% 0 - 0

Line Branch Decision Exec Source
1 /*
2 * trigger_suzuki.cpp
3 *
4 * @date Oct 4, 2021
5 * @author Andrey Belomutskiy, (c) 2012-2021
6 */
7
8 #include "pch.h"
9
10 #include "trigger_suzuki.h"
11
12 1 void initializeSuzukiG13B(TriggerWaveform *s) {
13 1 s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::RiseOnly);
14
15 1 float w = 5;
16 1 float specialTooth = 20;
17
18 1 s->addEvent720(180 - w, TriggerValue::RISE);
19 1 s->addEvent720(180, TriggerValue::FALL);
20
21 1 s->addEvent720(2 * specialTooth + 180 - w, TriggerValue::RISE);
22 1 s->addEvent720(2 * specialTooth + 180, TriggerValue::FALL);
23
24 1 s->addEvent720(360 - w, TriggerValue::RISE);
25 1 s->addEvent720(360, TriggerValue::FALL);
26
27 1 s->addEvent720(540 - w, TriggerValue::RISE);
28 1 s->addEvent720(540, TriggerValue::FALL);
29
30 1 s->addEvent720(720 - w, TriggerValue::RISE);
31 1 s->addEvent720(720, TriggerValue::FALL);
32
33 1 s->setTriggerSynchronizationGap(0.22);
34 1 s->setSecondTriggerSynchronizationGap(1);
35 1 }
36
37 1 void initializeSuzukiK6A(TriggerWaveform *s) {
38 1 s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::RiseOnly);
39 1 float w = 5;
40
41 1 int secondTooth = 15;
42
43 // a bit lame: we start with falling front of first tooth
44 1 s->addEvent360(5, TriggerValue::FALL);
45
46 1 s->addToothRiseFall(secondTooth, w);
47 1 s->addToothRiseFall(43, w);
48
49 1 s->addToothRiseFall(120, w);
50 1 s->addToothRiseFall(120 + secondTooth, w);
51 1 s->addToothRiseFall(158, w);
52 1 s->addToothRiseFall(158 + secondTooth, w);
53
54 1 s->addToothRiseFall(240, w);
55 1 s->addToothRiseFall(240 + secondTooth, w);
56 1 s->addToothRiseFall(283, w);
57
58 // a bit lame: we end with rising front of first tooth
59 1 s->addEvent360(360, TriggerValue::RISE);
60
61 1 s->setTriggerSynchronizationGap(4.47);
62 1 s->setSecondTriggerSynchronizationGap(0.65);
63 1 }
64