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

Use embedded-hal 1.0.0 #1

Merged
merged 7 commits into from
Jun 24, 2024
Merged

Conversation

dan-corneanu
Copy link
Contributor

Update lib to use embedded-hal 1.0.0

@dan-corneanu
Copy link
Contributor Author

@eldruin I've updated the driver to use embedded-hal 1.0.0 because I have a project in which I need to share the same SPI bus between two devices. However, it seems that the specs fail on some of the architectures and I have no clue what is wrong. Could you please advise?

Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thank you for your work!
The problem in the CI is because of the embedded-hal-bus dependency but we do not need it here.
The tests and examples would need to be adapted as well, though.
For that you can update the embedded-hal-mock dependency to embedded-hal-mock = { version="0.10", default-features=false, features=["eh1"]}
You can have a look at this PR for inspiration, for example: https://github.com/eldruin/bmi160-rs/pull/7/files

Cargo.toml Outdated
@@ -21,7 +21,8 @@ include = [
edition = "2018"

[dependencies]
embedded-hal = "0.2.6"
embedded-hal = { version = "1.0.0"}
embedded-hal-bus = { version = "0.2.0" }
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
embedded-hal-bus = { version = "0.2.0" }

We do not need this in a driver

Cargo.toml Outdated
@@ -21,7 +21,8 @@ include = [
edition = "2018"

[dependencies]
embedded-hal = "0.2.6"
embedded-hal = { version = "1.0.0"}
embedded-hal-bus = { version = "0.2.0" }

[dev-dependencies]
linux-embedded-hal = "0.3"
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
linux-embedded-hal = "0.3"
linux-embedded-hal = "0.4"

@dan-corneanu dan-corneanu force-pushed the shared_spi_bus branch 2 times, most recently from 323b547 to db5024e Compare June 21, 2024 09:36
@dan-corneanu
Copy link
Contributor Author

@eldruin I've updated the tests and all of them are passing now. However, I don't know how to solve the cargo-tarpaulin and clippy issues. I need your help with these two.

@eldruin
Copy link
Owner

eldruin commented Jun 21, 2024

Thank you! The CI configuration was a bit outdated. I have updated it and now everything passes except one trivial error reported by clippy.
Could you also add an entry to the changelog?

@dan-corneanu
Copy link
Contributor Author

Would you mind giving me your advice on rust-embedded/embedded-hal#608 please?

Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Great, thank you.
Sorry, could you also update the example in the readme?

Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Great work, thank you!

@eldruin eldruin merged commit 48349ea into eldruin:master Jun 24, 2024
22 checks passed
@eldruin
Copy link
Owner

eldruin commented Jun 24, 2024

For the record, I have published this in version 1.0.0.

@dan-corneanu dan-corneanu deleted the shared_spi_bus branch June 24, 2024 07:48
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.

2 participants