| 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 | 4248916 | 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 4248914 times.
|
2/2✓ Decision 'true' taken 2 times.
✓ Decision 'false' taken 4248914 times.
|
4248916 | 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 4248826 times.
✓ Branch 2 taken 88 times.
✗ Branch 3 not taken.
|
4248914 | 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 |