GCC Code Coverage Report


Directory: ./
File: unit_tests/adc_inputs.h
Date: 2025-10-03 00:57:22
Coverage Exec Excl Total
Lines: 100.0% 4 0 4
Functions: 100.0% 1 0 1
Branches: 83.3% 5 0 6
Decisions: 100.0% 2 - 2

Line Branch Decision Exec Source
1 /**
2 * @file adc_inputs.h
3 *
4 * @date Dec 7, 2013
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8 #pragma once
9
10 #include "rusefi_hw_enums.h"
11
12 4183924 inline bool isAdcChannelValid(adc_channel_e hwChannel) {
13 /* Compiler will optimize, keep following if as a reminder */
14
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 4183922 times.
2/2
✓ Decision 'true' taken 2 times.
✓ Decision 'false' taken 4183922 times.
4183924 if (hwChannel >= EFI_ADC_TOTAL_CHANNELS) {
15 /* this should not happen!
16 * if we have enum out of range somewhere in settings
17 * that means something goes terribly wrong
18 * TODO: should we say something?
19 */
20 2 return false;
21 }
22
3/4
✓ Branch 0 taken 88 times.
✓ Branch 1 taken 4183834 times.
✓ Branch 2 taken 88 times.
✗ Branch 3 not taken.
4183922 return ((hwChannel > EFI_ADC_NONE) && (hwChannel < EFI_ADC_TOTAL_CHANNELS));
23 }
24
25 inline bool isAdcChannelOnChip(adc_channel_e hwChannel) {
26 return (isAdcChannelValid(hwChannel) && (hwChannel <= EFI_ADC_ONCHIP_LAST));
27 }
28
29 #define adcToVoltsDivided(adc) (adcToVolts(adc) * engineConfiguration->analogInputDividerCoefficient)
30 #define GPT_FREQ_FAST 100000
31 #define GPT_PERIOD_FAST 10
32
33 #include "boards.h"
34