Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEEDSTEST: stm32f0: comparator: fix memory accesses #1463

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

karlp
Copy link
Member

@karlp karlp commented Feb 2, 2023

Fixes: #1289

While it had seemed a clever trick to access COMP_CSR as two 16bit registers, apparently in the real world, this didn't behave as expected.

Switch the register definitions to 32bit and adjust all the functions to auto select the correct portion of the register.

NEEDSTEST: this has been coded only, I personally have no code using this, but it seems like the correct approach, and the current code is obviously broken.

Signed-off-by: Karl Palsson karlp@tweak.au

Fixes: libopencm3#1289

While it had seemed a clever trick to access COMP_CSR as two 16bit
registers, apparently in the real world, this didn't behave as expected.

Switch the register definitions to 32bit and adjust all the functions to
auto select the correct portion of the register.

NEEDSTEST: this has been coded only, I personally have no code using
this, but it seems like the correct approach, and the current code is
obviously broken.

Signed-off-by: Karl Palsson <karlp@tweak.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access to COMP_CSR using MMIO16 writes same data to both half of the 32 bit register on STM32F0
1 participant