diff --git a/firmware/controllers/sensors/impl/software_knock.cpp b/firmware/controllers/sensors/impl/software_knock.cpp index 816a83ef8e..a1149095d9 100644 --- a/firmware/controllers/sensors/impl/software_knock.cpp +++ b/firmware/controllers/sensors/impl/software_knock.cpp @@ -55,38 +55,46 @@ static const uint32_t smpr2 = ADC_SMPR2_SMP_AN8(KNOCK_SAMPLE_TIME) | ADC_SMPR2_SMP_AN9(KNOCK_SAMPLE_TIME); -static const ADCConversionGroup adcConvGroupCh1 = { FALSE, 1, &completionCallback, &errorCallback, - 0, - ADC_CR2_SWSTART, +static const ADCConversionGroup adcConvGroupCh1 = { + .circular = FALSE, + .num_channels = 1, + .end_cb = &completionCallback, + .error_cb = &errorCallback, + .cr1 = 0, + .cr2 = ADC_CR2_SWSTART, // sample times for channels 10...18 - smpr1, + .smpr1 = smpr1, // sample times for channels 0...9 - smpr2, + .smpr2 = smpr2, - 0, // htr - 0, // ltr + .htr = 0, + .ltr = 0, - 0, // sqr1 - 0, // sqr2 - ADC_SQR3_SQ1_N(KNOCK_ADC_CH1) + .sqr1 = 0, + .sqr2 = 0, + .sqr3 = ADC_SQR3_SQ1_N(KNOCK_ADC_CH1) }; // Not all boards have a second channel - configure it if it exists #if KNOCK_HAS_CH2 -static const ADCConversionGroup adcConvGroupCh2 = { FALSE, 1, &completionCallback, &errorCallback, - 0, - ADC_CR2_SWSTART, - // sample times for channels 10...18 - smpr1, - // sample times for channels 0...9 - smpr2, - - 0, // htr - 0, // ltr - - 0, // sqr1 - 0, // sqr2 - ADC_SQR3_SQ1_N(KNOCK_ADC_CH2) +static const ADCConversionGroup adcConvGroupCh2 = { + .circular = FALSE, + .num_channels = 1, + .end_cb = &completionCallback, + .error_cb = &errorCallback, + .cr1 = 0, + .cr2 = ADC_CR2_SWSTART, + // sample times for channels 10...18 + .smpr1 = smpr1, + // sample times for channels 0...9 + .smpr2 = smpr2, + + .htr = 0, + .ltr = 0, + + .sqr1 = 0, + .sqr2 = 0, + .sqr3 = ADC_SQR3_SQ1_N(KNOCK_ADC_CH2) }; #endif // KNOCK_HAS_CH2