GCC Code Coverage Report


Directory: ./
File: firmware/controllers/modules/fuel_pump/fuel_pump.cpp
Date: 2025-10-03 00:57:22
Coverage Exec Excl Total
Lines: 100.0% 13 0 13
Functions: 100.0% 2 0 2
Branches: 75.0% 9 0 12
Decisions: 50.0% 2 - 4

Line Branch Decision Exec Source
1 /**
2 * low pressure fuel pump control
3 * for high-pressure see HpfpController@high_pressure_fuel_pump
4 *
5 */
6 #include "pch.h"
7
8 #include "fuel_pump.h"
9 #include "bench_test.h"
10
11 1089 void FuelPumpController::onSlowCallback() {
12 1089 auto timeSinceIgn = m_ignOnTimer.getElapsedSeconds();
13
14 // If the ignition just turned on, turn on the fuel pump to prime
15
3/4
✓ Branch 0 taken 1089 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 87 times.
✓ Branch 3 taken 1002 times.
1089 isPrime = timeSinceIgn >= 0 && timeSinceIgn < engineConfiguration->startUpFuelPumpDuration;
16
17 #if EFI_SHAFT_POSITION_INPUT
18 // If there was a trigger event recently, turn on the pump, the engine is running!
19 1089 engineTurnedRecently = engine->triggerCentral.engineMovedRecently();
20 #endif //EFI_SHAFT_POSITION_INPUT
21
22
4/4
✓ Branch 0 taken 1002 times.
✓ Branch 1 taken 87 times.
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 1001 times.
1089 isFuelPumpOn = isPrime || engineTurnedRecently;
23
24
1/2
✓ Branch 1 taken 1089 times.
✗ Branch 2 not taken.
1/2
✓ Decision 'true' taken 1089 times.
✗ Decision 'false' not taken.
1089 if (!isRunningBenchTest()) {
25 1089 enginePins.fuelPumpRelay.setValue("FP", isFuelPumpOn);
26 }
27 1089 }
28
29 5 void FuelPumpController::onIgnitionStateChanged(bool ignitionOnParam) {
30 // live data parser convention is asking for a field
31 5 ignitionOn = ignitionOnParam;
32
1/2
✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
1/2
✓ Decision 'true' taken 5 times.
✗ Decision 'false' not taken.
5 if (ignitionOn) {
33 5 m_ignOnTimer.reset();
34 }
35 5 }
36