qemu/qemu/02e9aebb8ecdf9c19c7e2d0ecd62de8ff0c6827f
hw/adc/stm32f2xx_adc: fix left-aligned conversion results
Left-aligned regular conversion results must occupy bits [15:4],
[15:6], or [15:8] for 12-, 10-, or 8-bit resolution respectively.
At 6-bit resolution the result is aligned within a byte, in bits [7:2].
The current single-bit shift and 0xFFF0 mask both misalign the result
and discard significant sample bits. Select the shift according to RES
and keep the existing right-aligned sample generation unchanged.
Signed-off-by: Manuele Conti <conti.manuele@gmail.com>
Message-id: 20261020211529.99689-1-conti.manuele@gmail.com
[PMM: expanded comment slightly, added brackets for clarity]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1 file changed