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

raspberrypi: Honor the requested offset= of a StateMachine #10010

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

jepler
Copy link
Member

@jepler jepler commented Jan 28, 2025

The logic to do this was lost in my recent re-organization. Happily, just setting this field appropriately fixes it.

The logic to do this was lost in my recent re-organization.
Happily, just setting this field appropriately fixes it.
@jepler jepler requested a review from dhalbert January 28, 2025 14:57
@jepler
Copy link
Member Author

jepler commented Jan 28, 2025

Testing performed: I was using an implementation of quadrature encoder that required being loaded at address 0. It was loaded at address 4(?) instead, because loading at higher addresses is favored, and it didn't work.

You can test with something like

import array
import rp2pio
sm = rp2pio.StateMachine(array.array('H', [0]), 0, offset=1)
assert sm.offset == 1

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this!

@dhalbert dhalbert merged commit 0be2340 into adafruit:main Jan 28, 2025
154 checks passed
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.

2 participants