On Tue, 20 Oct 2026 at 22:15, Manuele Conti <[email protected]> wrote:
>
> 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 <[email protected]>
> ---
>  hw/adc/stm32f2xx_adc.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

Applied to target-arm.next, thanks. I expanded the comment
a little and added brackets round the "4 + 2 * resolution"
for clarity.

-- PMM

Reply via email to