diff --git a/firmware/analog_input.cpp b/firmware/analog_input.cpp index cb2b2fa..77e1e22 100644 --- a/firmware/analog_input.cpp +++ b/firmware/analog_input.cpp @@ -2,14 +2,18 @@ #include "hal.h" +#define ADC_CHANNEL_COUNT 3 #define ADC_OVERSAMPLE 8 -static adcsample_t adcBuffer[3 * ADC_OVERSAMPLE]; +static adcsample_t adcBuffer[ADC_CHANNEL_COUNT * ADC_OVERSAMPLE]; ADCConversionGroup convGroup = { - false, 3, nullptr, nullptr, - 0, // CFGR1 + false, + ADC_CHANNEL_COUNT, + nullptr, + nullptr, + ADC_CFGR1_CONT | ADC_CFGR1_RES_12BIT, // CFGR1 ADC_TR(0, 0), // TR ADC_SMPR_SMP_28P5, // SMPR ADC_CHSELR_CHSEL0 | ADC_CHSELR_CHSEL1 | ADC_CHSELR_CHSEL2