Code: Select all
Compiling stm32_bdma.c
../../../ChibiOS_20.3_stable/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c: In function 'adc_lld_start_conversion':
../../../ChibiOS_20.3_stable/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c:694:23: error: 'cfgr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
694 | adcp->adcm->CFGR = cfgr;
In fact the variable is only uninitialized if we pass incorrect ADC driver address, neither &ADC1 nor &ADC3, but the compiler cannot guess that. Simple fix is initializing cfgr with 0 on the declaration line.
Alexandre