mirror of https://github.com/rusefi/rusefi.git
adc: fix unit tests
This commit is contained in:
parent
6b265dd4f8
commit
909a17caef
|
@ -10,18 +10,16 @@
|
|||
#include "rusefi_hw_enums.h"
|
||||
|
||||
inline bool isAdcChannelValid(adc_channel_e hwChannel) {
|
||||
if (hwChannel <= EFI_ADC_NONE) {
|
||||
return false;
|
||||
} else if (hwChannel >= EFI_ADC_LAST_CHANNEL) {
|
||||
/* Compiler will optimize, keep following if as a reminder */
|
||||
if (hwChannel >= EFI_ADC_TOTAL_CHANNELS) {
|
||||
/* this should not happen!
|
||||
* if we have enum out of range somewhere in settings
|
||||
* that means something goes terribly wrong
|
||||
* TODO: should we say something?
|
||||
*/
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return ((hwChannel > EFI_ADC_NONE) && (hwChannel < EFI_ADC_TOTAL_CHANNELS));
|
||||
}
|
||||
|
||||
#define adcToVoltsDivided(adc) (adcToVolts(adc) * engineConfiguration->analogInputDividerCoefficient)
|
||||
|
|
Loading…
Reference in New Issue