Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with using SPI DMA TX in RTIC #383

Open
mryndzionek opened this issue Jan 2, 2022 · 2 comments
Open

Problem with using SPI DMA TX in RTIC #383

mryndzionek opened this issue Jan 2, 2022 · 2 comments

Comments

@mryndzionek
Copy link
Contributor

Hello,
I would like to use the SPI DMA XFER functionality in RTIC. The problem is that write like here moves spi_dma. In RTIC tasks everything is accessible via a mutable reference, so when I call write I get:

error[E0507]: cannot move out of `*spi_dma` which is behind a mutable reference
@burrbull
Copy link
Contributor

burrbull commented Jan 2, 2022

You could wrap it in Option and use Option::take for access

@mryndzionek
Copy link
Contributor Author

Is this idiomatic and only solution?

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

No branches or pull requests

2 participants