pico-extras
pico-extras copied to clipboard
should audio_i2s_setup claim the dma channel requested by the user?
audio_i2s_setup has a config passed in which includes the dma channel to use. It claims this dma channel. But should the caller claim the channel instead? As there's no guarantee the channel will be free by the time audio_i2s_setup tries to claim it?
It also has a configuration item for the pio state machine whereas the pio itself is a build time configuration. Would it not be better for it to just search for a free pio/sm itself?
These libraries predated the claiming APIs most likely, but sometimes it is good/important to use specific PIO/SM
All for updating them, but needs to be done in a way that preserves the existing behavior (i.e. either use a -1 or something for auto-pick, and/or use a #define to control stuff) - if you have a look around, i think there are other places where we have made previously provided #defines optional, and if they aren't present then auto-select
it is good/important to use specific PIO/SM That makes sense. It's just a bit clunky that the pio is a #define but the sm is a value in a config structure?