How to determine PIO instance assigned to a SerialPIO ? #2466
Unanswered
myklemykle
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Is there any handy way to query which PIO resources are being used by a given SerialPIO instance?
One gotcha I've had since upgrading to 4.0.2 is that the algorithm that assigns PIO resources to a SerialPIO instance now allocates state machines from PIO1 first, whereas before it used PIO0 first. My code was glossing over that difference, but it was important to know for a couple of reasons. For one, I switched the tip & ring pins of my device between several different peripherals, like so:
The MIDI portion of that stopped working in core 4.0.2, because the SerialPIO instances that provide the MIDI mode are not ending up on PIO0 any more; they're now appearing on PIO1. So I had to tweak that function a little:
This works for me, for now, but OTOH if I add some other PIO-using library to this sketch, I won't be able to predict which PIO instance goes to which SerialPIO instance.
-m-
Beta Was this translation helpful? Give feedback.
All reactions