-
Notifications
You must be signed in to change notification settings - Fork 18
Add some examples, improve the assembler #11
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these improvements! Just a few comments.
if target[:1] in "0123456789": | ||
assembled[-1] |= int(target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check will only work for single digit targets but it could be up to 32. Instead, you could try and int(target)
and then catch the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite, but maybe the code is too clever as written. It looks whether the first character (if present) in target is a digit.
examples/pico-examples/hello.py
Outdated
sm = rp2pio.StateMachine( | ||
assembled, | ||
frequency=80, | ||
init=adafruit_pioasm.assemble("set pindirs 1"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need this init or the set pin anymore.
examples/pico-examples/hello.py
Outdated
|
||
sm = rp2pio.StateMachine( | ||
assembled, | ||
frequency=80, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The state machine can't go this slow and CP should now raise an error to tell you that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you!
Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.2.0 from 0.1.6: > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#11 from adafruit/jepler-examples-improvements
Assembler improvements:
Examples: