From c4cbdf0d77c40a8cbc0e436d1ea75403725a31cc Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 7 Sep 2020 15:50:37 -0400 Subject: [PATCH] Hellen says merge #1772 ADC flexibility --- firmware/hw_layer/AdcConfiguration.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/firmware/hw_layer/AdcConfiguration.h b/firmware/hw_layer/AdcConfiguration.h index e63486e19c..b6a7b2a802 100644 --- a/firmware/hw_layer/AdcConfiguration.h +++ b/firmware/hw_layer/AdcConfiguration.h @@ -9,7 +9,9 @@ #if HAL_USE_ADC +#ifndef ADC_MAX_CHANNELS_COUNT #define ADC_MAX_CHANNELS_COUNT 16 +#endif /* ADC_MAX_CHANNELS_COUNT */ // this structure contains one multi-channel ADC state snapshot typedef struct { @@ -22,7 +24,7 @@ public: void enableChannel(adc_channel_e hwChannelIndex); void enableChannelAndPin(adc_channel_e hwChannelIndex); adc_channel_e getAdcHardwareIndexByInternalIndex(int index) const; - int internalAdcIndexByHardwareIndex[20]; + int internalAdcIndexByHardwareIndex[ADC_MAX_CHANNELS_COUNT + 4]; bool isHwUsed(adc_channel_e hwChannel) const; int size() const; void init(void); @@ -48,8 +50,8 @@ private: /** * Number of ADC channels in use */ - - adc_channel_e hardwareIndexByIndernalAdcIndex[20]; + + adc_channel_e hardwareIndexByIndernalAdcIndex[ADC_MAX_CHANNELS_COUNT + 4]; }; #endif /* HAL_USE_ADC */