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

Clarify flushing/"blocking" behavior #455

Closed
Florob opened this issue Apr 30, 2023 · 1 comment · Fixed by #557
Closed

Clarify flushing/"blocking" behavior #455

Florob opened this issue Apr 30, 2023 · 1 comment · Fixed by #557
Milestone

Comments

@Florob
Copy link

Florob commented Apr 30, 2023

The SpiDevice trait's documentation is now very explicit that operations may return before they are finished. That brings up some questions:

  1. What happens with adjacent operations? E.g. if there are two back-to-back write() calls, is it legal for the second call to return Err(Busy), or is it expected that this call will block until it can enqueue the operation?
  2. In the same vein, is calling write(); write(); acceptable for drivers, or does it have to be write(); flush(); write() to not risk an error?
  3. What about other traits like I2C? They do not mention that returning early is acceptable. Does that imply that they block until the bus is idle? If not, why don't they have a flush() operation. If so, shouldn't that be explicitly documented?
@eldruin
Copy link
Member

eldruin commented May 9, 2023

Points 1. and 2. have been fixed in #456.
We may need documentation improvements for the I2C case.

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 a pull request may close this issue.

2 participants