-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/atmega_common: Fix atmega_port_addr() #18265
Conversation
@valentinpi: Care to test? |
Hi! I confirm that now everything works well! |
It seems that the compiler's optimizer trips over the For me, the code still works. Care to test it again? |
For reference: This models the memory layout of the three registers per GPIO port: RIOT/cpu/atmega_common/include/periph_cpu_common.h Lines 103 to 130 in d9fc082
That is why I reordered the functions now to match the order they come in memory. Interestingly, the datasheet lists the registers in reverse order (in regard to their address) as well: |
The current version is working for me. |
For me too. This probably resolve these BUGs. |
So then squash to get this through CI |
In 04ab5a7 a bug was introduced in the calculation of the GPIO port address by refactoring code. This fixes the issue by extracting the GPIO port first from the pin.
cb661e2
to
b72cafb
Compare
@krzysztof-cabaj and @valentinpi: Thanks for reporting the issue and testing! @benpicco: Thx for the quick review :) |
Contribution description
In 04ab5a7 a bug was introduced in
the calculation of the GPIO port address by refactoring code. This
fixes the issue by extracting the GPIO port first from the pin.
Testing procedure
See #18245 (comment)
Issues/PRs references
Reported in #18245 (comment)