STM32CubeL4 icon indicating copy to clipboard operation
STM32CubeL4 copied to clipboard

LL ADC has duplicated arguments

Open vpetrigo opened this issue 4 years ago • 2 comments

Hello,

This part in the ADC LL driver contains duplicated arguments in & chain:

https://github.com/STMicroelectronics/STM32CubeL4/blob/d023c0d560ace11509f9b761c8913a9e48fcf194/Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h#L5216

Since READ_BIT is expanded to that:

((*preg) & AWDy))

The second AWDy usage is redundant. So all that expression can be simplified to that:

uint32_t AnalogWDMonitChannels = (READ_BIT(*preg, AWDy) & ADC_AWD_CR_ALL_CHANNEL_MASK);

vpetrigo avatar Feb 17 '21 12:02 vpetrigo

Hi @vpetrigo,

The issue you pointed out has been confirmed. Indeed, The second AWDy usage is redundant. A fix will be implemented and made available in future release. Thank you once again for your contribution.

With regards,

ASELSTM avatar Feb 19 '21 13:02 ASELSTM

ST Internal Reference: 101705

ASELSTM avatar Feb 19 '21 13:02 ASELSTM

Hi @vpetrigo,

Thank you for your contribution. This issue has been fixed in the frame of version v1.17.1 of the STM32CubeL4. Please allow me then to close this thread.

With regards,

ASELSTM avatar Apr 06 '23 09:04 ASELSTM