adc: rename EFI_ADC_LAST_CHANNEL to EFI_ADC_TOTAL_CHANNELS

This commit is contained in:
Andrey Gusakov 2024-05-05 15:30:50 +03:00
parent 2425fc5599
commit eceb8a8958
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ typedef enum __attribute__ ((__packed__)) {
EFI_ADC_30 = 31,
EFI_ADC_31 = 32,
EFI_ADC_LAST_CHANNEL = 33, // Please keep this in sync with the last valid channel index!
EFI_ADC_TOTAL_CHANNELS = 33, // Please keep this in sync with the last valid channel index!
EFI_ADC_ERROR = 50,
} adc_channel_e;

View File

@ -31,7 +31,7 @@ public:
explicit AdcDevice(ADCConversionGroup* hwConfig, adcsample_t *buf, size_t buf_len);
void enableChannel(adc_channel_e hwChannelIndex);
adc_channel_e getAdcHardwareIndexByInternalIndex(int index) const;
uint8_t internalAdcIndexByHardwareIndex[EFI_ADC_LAST_CHANNEL];
uint8_t internalAdcIndexByHardwareIndex[EFI_ADC_TOTAL_CHANNELS];
bool isHwUsed(adc_channel_e hwChannel) const;
int size() const;
void init(void);

View File

@ -20,7 +20,7 @@ float getAnalogInputDividerCoefficient(adc_channel_e);
inline bool isAdcChannelValid(adc_channel_e hwChannel) {
if (hwChannel <= EFI_ADC_NONE) {
return false;
} else if (hwChannel >= EFI_ADC_LAST_CHANNEL) {
} else 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