How to get the ID of a StateMachine object #11595
Replies: 5 comments
-
Yes this would probably be useful, and in general on most types in the In the meantime though, all of these built-in objects are comparable (i.e. you can use the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer. Are there any efficient ways ? (In viper or inline
assembly). I guess just reading the IRQ register is probably the best way ?
…On Tue, May 23, 2023 at 2:10 AM Jim Mussared ***@***.***> wrote:
Yes this would probably be useful, and in general on most types in the
machine module -- e.g. going from a Pin instance back to its actual pin
number.
In the meantime though, all of these built-in objects are comparable (i.e.
you can use the in operator on a list, or list.index) and (as of a few
days ago in the nightly builds) hashable (so they can be keys in
dictionaries). So given a statemachine instance, there are several easy
ways to find out which one it is.
—
Reply to this email directly, view it on GitHub
<#11595 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPMOGZGEHBSJJRX4KSIZCLXHRIFNANCNFSM6AAAAAAYLJLCLY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I just realized this is particularly a problem because it is impossible to have hard interrupts if the handler are closures, so there is really no way in python to identify which state machine is interrupting. I get
If I try that. Hard interrupts only work when they are a global scope (so no way to have one per state machine without having a copy of the interrupt for every single one. |
Beta Was this translation helpful? Give feedback.
-
It Also seems that the Interrupt Flags are cleared before the handler is called so I'm really not sure how I can possibly know which StateMachine is being triggered (fast). |
Beta Was this translation helpful? Give feedback.
-
There is an undocumented functionality in array.array: The 'o' typecode, that allows to inspect the data stored at MPs objects.
|
Beta Was this translation helpful? Give feedback.
-
Hello,
How can I get the id of the state machine that triggered a PIO IRQ. It seems that the only argument passed is the state machine that triggered it. But it's kind of useless because we have no attribute available to tell us which one it actually is.
Maybe it would be good to have an attribute. It seems that the data is available from the backend since
str(machine)
is working.Beta Was this translation helpful? Give feedback.
All reactions