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 */