mirror of https://github.com/rusefi/rusefi.git
adc: introduce external adc channels
This commit is contained in:
parent
fe3b6eb26b
commit
6b265dd4f8
|
@ -34,7 +34,20 @@ typedef enum __attribute__ ((__packed__)) {
|
|||
EFI_ADC_30 = 31,
|
||||
EFI_ADC_31 = 32,
|
||||
|
||||
EFI_ADC_TOTAL_CHANNELS = 33, // Please keep this in sync with the last valid channel index!
|
||||
// External ADC channels
|
||||
EFI_ADC_32 = 33,
|
||||
EFI_ADC_33 = 34,
|
||||
EFI_ADC_34 = 35,
|
||||
EFI_ADC_35 = 36,
|
||||
EFI_ADC_36 = 37,
|
||||
EFI_ADC_37 = 38,
|
||||
EFI_ADC_38 = 39,
|
||||
EFI_ADC_39 = 40,
|
||||
|
||||
EFI_ADC_TOTAL_CHANNELS = 41, // Please keep this in sync with the last valid channel index!
|
||||
|
||||
EFI_ADC_ERROR = 50,
|
||||
} adc_channel_e;
|
||||
|
||||
/* Please keep updating these define(s) */
|
||||
#define EFI_ADC_ONCHIP_LAST EFI_ADC_31
|
||||
|
|
|
@ -30,6 +30,15 @@ inline bool isAdcChannelValid(adc_channel_e hwChannel) {
|
|||
return ((hwChannel > EFI_ADC_NONE) && (hwChannel < EFI_ADC_TOTAL_CHANNELS));
|
||||
}
|
||||
|
||||
inline bool isAdcChannelOnChip(adc_channel_e hwChannel) {
|
||||
return (isAdcChannelValid(hwChannel) && (hwChannel <= EFI_ADC_ONCHIP_LAST));
|
||||
}
|
||||
|
||||
inline bool isAdcChannelOffChip(adc_channel_e hwChannel) {
|
||||
return (isAdcChannelValid(hwChannel) && (hwChannel > EFI_ADC_ONCHIP_LAST));
|
||||
}
|
||||
|
||||
|
||||
#if !defined(GPT_FREQ_FAST) || !defined(GPT_PERIOD_FAST)
|
||||
/**
|
||||
* 8000 RPM is 133Hz
|
||||
|
|
Loading…
Reference in New Issue