GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 16 / 0 / 16
Functions: 100.0% 3 / 0 / 3
Branches: 100.0% 14 / 0 / 14
Decisions: 100.0% 6 / - / 6

firmware/controllers/engine_cycle/rotational_idle.cpp
Line Branch Decision Exec Source
1 #include "pch.h"
2 #include "rotational_idle.h"
3
4 696 RotationalIdle::RotationalIdle(){
5
6 696 }
7
8 6 bool RotationalIdle::shouldEngageRotationalIdle() {
9 6 rotationalIdleEngaged = false;
10
11
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 5 times.
2/2
✓ Decision 'true' taken 1 time.
✓ Decision 'false' taken 5 times.
6 if (!engineConfiguration->rotationalIdleController.enabled) {
12 1 return false;
13 }
14
15 //TODO: we need to use deadbands ond this!! (and on the tps/pps)
16
6/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 4 times.
2/2
✓ Decision 'true' taken 1 time.
✓ Decision 'false' taken 4 times.
5 if (engineConfiguration->rotationalIdleController.auto_engage_clt_enable && Sensor::getOrZero(SensorType::Clt) > engineConfiguration->rotationalIdleController.auto_engage_clt) {
17 1 rotationalIdleEngaged = true;
18 1 return true;
19 }
20
21 // TODO: auto_engage sounds too generic, maybe better auto_engage_pps_enable?
22
6/6
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 2 times.
2/2
✓ Decision 'true' taken 2 times.
✓ Decision 'false' taken 2 times.
4 if (engineConfiguration->rotationalIdleController.auto_engage && Sensor::getOrZero(SensorType::DriverThrottleIntent) <= engineConfiguration->rotationalIdleController.max_tps) {
23 2 rotationalIdleEngaged = true;
24 2 return true; // tps is below the maximum
25 }
26
27 2 return false;
28 }
29
30 /**
31 * @param offset The offset value to adjust the global spark counter
32 * in skip calculations.
33 * @return True if rotational idle operations should be skipped, false otherwise.
34 */
35 3 bool RotationalIdle::shouldSkipSparkRotationalIdle(int8_t offset) {
36 3 bool result = false;
37
38 3 return result;
39 }
40