-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add support for the assembly instructions in @asm_pio
functions
#767
Comments
Can you share the code, |
The code is here: https://gist.github.com/DeflateAwning/cfc26095d25390fcd3c619176c7bf23e I was using these stubs: https://pypi.org/project/micropython-rp2-pico-stubs/ |
I have already built it , but not (yet) included it as part of the rp2 stubs. if you want it today - you need to add it manually to the stubs
See for more details : |
That's very neat, thank you very much! Looking forward to giving it a try. In the final release, will we need to import anything? Or it'll work automatically? |
You'll need the somewhat ugly activation blurb # -----------------------------------------------
# add type hints for the rp2.PIO Instructions
try:
from typing_extensions import TYPE_CHECKING # type: ignore
except ImportError:
TYPE_CHECKING = False
if TYPE_CHECKING:
from rp2.asm_pio import *
# ----------------------------------------------- before the first @asm_pio . there is a cpython decorator |
This is perfect as-is! Thanks a lot! |
Here's an example of what the type checking looks like currently (observe all the errors) for
@asm_pio
-decorated Programmable IO assembly code blocks:Doing a bit of digging around, I found that the
PIOASMEmit
class seems to define these functions, but there's no way to move those member functions to imports.I think the best solution would be to make them global functions, probably. Or maybe there's a way to highjack the
@asm_pio
decorator so that it considers the assembly functions only in that function.The text was updated successfully, but these errors were encountered: