Open jkozniewski opened 2 months ago
Hi @jkozniewski,
Can you please take a look at https://github.com/Josverl/PIO_ASM_typing and let me know if that would be helpful.
With pio_asm_types |
---|
![]() |
I have not packaged or published this, So you will will need to copy some files into your typing folder, MicroPico puts that in a non default folder, but should not be hard to find.
copy to typings/rp2
include in your source ( and also sync to the rp2040 board) :
Feedback?
@Josverl Thanks for your contribution. I've just got back from a trip so I can test. @paulober - so where is the folder for MicroPico typings where I can paste the files ?
@paulober - so where is the folder for MicroPico typings where I can paste the files ?
You can find the installed stubs in $HOME/.micropico-stubs/included
(if you want to modify the included ones) but keep in mind that changes to this can be overwritten by a new update of the extension.)
Ok, thanks, I'll give it a try.
On a related note - seems that the micropython stubs are also not up to date in regard with rp2.DMA
class and the attributes such as count
etc - as per docs: https://docs.micropython.org/en/latest/library/rp2.DMA.html
@jkozniewski,
Thanks for notification
Currently I publish the stubs for each release, it may take some manual adjusting as new documentation tends to come with some quicks and additional adjustments that need hands on keyboard, the stubs for v1.23.0 are available and these do include the DMA class See :
I also build stubs for the preview versions of micropython - but I currently do no push them to PyPi as that would create a lot of churn. If you need / want that they could be installed directly from Github with the proper URL
If you find any other things that you´d like improved, please do let me know at : https://github.com/Josverl/micropython-stubs/issues
What are the steps to reproduce this issue?
Write code decorated with @rp2.asm_pio using special functions for controlling PIO on Pico
What happens?
Pylance does not recognise those functions ( such as out(), wrap() etc ) and marks them as error (vie screenshot attached)![Screenshot 2024-05-13 at 14 47 27](https://github.com/paulober/MicroPico/assets/6979983/d679bad7-4c83-444e-9731-a1a3b9c5484a)
What were you expecting to happen?
Pylance should be configured in a way that either disregards the contents of @rp2.asm_pio decorated function or should include definitions (stubs ?) of special functions used
Any other comments?
If there is any workaround that can be configured using Pylance settings directly (to somehow ignore a portion of code etc) I'd be grateful for tips of how to do so while waiting for some solution on extension-level (if possible at all).
Which version of MicroPico are you using?
3.7.6
Support info
Copy this from the
Help -> Info/About -> Copy
(Code -> About Visual Studio Code -> Copy
on macOS) option in Visual Studio Code: