Skip to content

Expose the underlying file object. #13

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

Merged

Conversation

de-vri-es
Copy link
Contributor

This PR adds the ability to use an already opened File object to create a new Spidev. Additionally, it adds read-only inner() and consuming into_inner() to access the underlying File object.

My primary reason for wanting this is that it allows to call flock() before using the spidev. That's something I want to do to avoid multiple processes controlling the same device.

And of course, if you can wrap an open File, it also makes sense to be able to access and retrieve it again.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nastevens (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@posborne
Copy link
Member

posborne commented Apr 2, 2019

Thanks @de-vri-es, looks reasonable. bors r+

@posborne
Copy link
Member

posborne commented Apr 2, 2019

Ah, haven't setup bors on this one yet.

@posborne posborne merged commit 97ef13b into rust-embedded:master Apr 2, 2019
@de-vri-es
Copy link
Contributor Author

Thanks for the quick review and merge :)

@de-vri-es de-vri-es mentioned this pull request Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants