CDCInterface vs UART - irq method #18724
Replies: 1 comment 5 replies
-
|
Hi @surfermarty,
That's a good point, something we could look at extending in CDCInterface as well.
Yes, that should work fine.
The IRQ class is implemented in C not Python, and there's no way to construct one from Python code. You could possibly implement a "works-alike" dummy IRQ class in Python, however you probably don't even need to do this:
The docs for Because these parts of the IRQ interface are totally ignored, it should be safe for your custom |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
CDCInterface has a comment:
but trying to use it with PPP over serial exposes that UART has an 'irq()' method that isn't implemented in CDCInterface and (as far as I can work out) in the subordinate classes. PPP class needs it to be there to use it.
Now I may be missing something dumb - can I wrapper the CDCInterface in another object to get the missing irq method?
Have been looking at a subclass that implements the missing irq function, but the UART docs say 'Returns an irq object.' and I'm struggling to find out how to create one of those currently (new to python and micropython). I've got a _thread based task to check for input availability and call the handler, but also an unhandled exception and stack trace when I attach it to the PPP class, so getting to grips with MP debugging too.
If anyone is able to throw light onto the missing 'irq' method or how I can work around it, that would be great.
Another area of confusion is that in the UART class 'irq' definition:
but in the PPP class, the connect method suggests it will be called as such
and the poll method is listed with out arguments
Beta Was this translation helpful? Give feedback.
All reactions