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

SpiBusDriver is not Send #395

Open
leonardodanelutti opened this issue Mar 19, 2024 · 2 comments
Open

SpiBusDriver is not Send #395

leonardodanelutti opened this issue Mar 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@leonardodanelutti
Copy link

Is there a reason why Send is implemented for SpiDeviceDriver and not for a SpiBusDriver? From the documentation there seems to be no difference between a SpiBusDriver without cs and a SpiBusDriver.

@ivmarkov
Copy link
Collaborator

ivmarkov commented Apr 30, 2024

This should be fixed. PRs welcome!

Background: All drivers should be Send but currently few (if any) are Sync. We can actually also do the latter too for most drivers because it turns out most esp idf APIs are thread safe.

But usually folks reaching out to Sync often means they might be doing something suboptimal, as in - say - trying to use the default tokio work-stealing executor, which is not ideal on embedded.

@Vollbrecht
Copy link
Collaborator

Still a workaround but should do it for most people is just sending the peripheral or the the wrapped SpiDriver as it is Send

@Vollbrecht Vollbrecht added the bug Something isn't working label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

3 participants