Line | Branch | Decision | Exec | Source |
---|---|---|---|---|
1 | /* | |||
2 | * @file trigger_rover.cpp | |||
3 | * | |||
4 | * @date Dec 27, 2015 | |||
5 | * @author PhilTheGeek | |||
6 | * @author Andrey Belomutskiy, (c) 2012-2020 | |||
7 | */ | |||
8 | ||||
9 | #include "pch.h" | |||
10 | ||||
11 | #include "trigger_rover.h" | |||
12 | ||||
13 | /** | |||
14 | * https://en.wikipedia.org/wiki/Rover_K-series_engine | |||
15 | */ | |||
16 | 1 | void initializeRoverK(TriggerWaveform *s) { | ||
17 | 1 | s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::RiseOnly); | ||
18 | ||||
19 | 1 | float tooth = 20; | ||
20 | ||||
21 | 1 | s->setTriggerSynchronizationGap(2.0); | ||
22 | // wow that's odd | |||
23 | 1 | s->setSecondTriggerSynchronizationGap2(0.0001, 100000); | ||
24 | 1 | s->setThirdTriggerSynchronizationGap(2); | ||
25 | ||||
26 | 1 | float base = 0; | ||
27 | ||||
28 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
|
2/2✓ Decision 'true' taken 2 times.
✓ Decision 'false' taken 1 time.
|
3 | for (int i = 0; i < 2; i++) { |
29 | 2 | s->addEvent720(base + tooth / 2, TriggerValue::RISE); | ||
30 | 2 | s->addEvent720(base + tooth, TriggerValue::FALL); | ||
31 | 2 | base += tooth; | ||
32 | } | |||
33 | 1 | base += tooth; | ||
34 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
|
2/2✓ Decision 'true' taken 2 times.
✓ Decision 'false' taken 1 time.
|
3 | for (int i = 0; i < 2; i++) { |
35 | 2 | s->addEvent720(base + tooth / 2, TriggerValue::RISE); | ||
36 | 2 | s->addEvent720(base + tooth, TriggerValue::FALL); | ||
37 | 2 | base += tooth; | ||
38 | } | |||
39 | 1 | base += tooth; | ||
40 |
2/2✓ Branch 0 taken 14 times.
✓ Branch 1 taken 1 time.
|
2/2✓ Decision 'true' taken 14 times.
✓ Decision 'false' taken 1 time.
|
15 | for (int i = 0; i < 14; i++) { |
41 | 14 | s->addEvent720(base + tooth / 2, TriggerValue::RISE); | ||
42 | 14 | s->addEvent720(base + tooth, TriggerValue::FALL); | ||
43 | 14 | base += tooth; | ||
44 | } | |||
45 | 1 | base += tooth; | ||
46 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
|
2/2✓ Decision 'true' taken 3 times.
✓ Decision 'false' taken 1 time.
|
4 | for (int i = 0; i < 3; i++) { |
47 | 3 | s->addEvent720(base + tooth / 2, TriggerValue::RISE); | ||
48 | 3 | s->addEvent720(base + tooth, TriggerValue::FALL); | ||
49 | 3 | base += tooth; | ||
50 | } | |||
51 | 1 | base += tooth; | ||
52 |
2/2✓ Branch 0 taken 11 times.
✓ Branch 1 taken 1 time.
|
2/2✓ Decision 'true' taken 11 times.
✓ Decision 'false' taken 1 time.
|
12 | for (int i = 0; i < 11; i++) { |
53 | 11 | s->addEvent720(base + tooth / 2, TriggerValue::RISE); | ||
54 | 11 | s->addEvent720(base + tooth, TriggerValue::FALL); | ||
55 | 11 | base += tooth; | ||
56 | } | |||
57 | ||||
58 | 1 | } | ||
59 |