Skip to content

Conversation

@dhalbert
Copy link
Contributor

@dhalbert dhalbert commented Oct 15, 2025

Helping to fix adafruit/circuitpython#10663, plus some other changes. Part of PR adafruit/circuitpython#10668

  • shared_dma_transfer_* routines were passing the dma_descr_t struct by value, which caused the caller not to see changes made by the callee,. In particular .progressstruct member changes were lost. Changed to pass by pointer.
  • Change name of that struct from dma_descr_t to dma_transfer_t to avoid confusion with hardware DMA descriptors also used in that code.
  • Define and use NO_DMA_CHANNEL instead of AUDIO_DMA_CHANNEL_COUNT and DMA_CHANNEL_COUNT to indicate an invalid channel number.
  • dma_allocate_channel(bool audio_channel) replaced by dma_allocate_audio_channel(void) and dma_allocate_non_audio_channel(void) to not pass control requests as arg and to clarify.
  • Remove duplicated incorrect copy-pasta comments in samd/samd21/dma.c.
  • dma.h: SAMD21 and SAMx5x have different numbers of DMA channels, so define DMA_CHANNEL_COUNT separately for each chip family.

Taggin @Randall-Scharpf for interest.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you!

@tannewt tannewt merged commit 863e615 into main Oct 16, 2025
dhalbert added a commit to dhalbert/circuitpython that referenced this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sdcardio: "OSError: can't set 512 block size" for some 32GB cards after 9.2.4

3 participants