Skip to content

Comments

Migrate I2C to embedded-hal 1.0#85

Merged
sosthene-nitrokey merged 1 commit intoembedded-hal-10from
i2c-embedded-hal-10
Sep 24, 2025
Merged

Migrate I2C to embedded-hal 1.0#85
sosthene-nitrokey merged 1 commit intoembedded-hal-10from
i2c-embedded-hal-10

Conversation

@sosthene-nitrokey
Copy link
Contributor

This PR keeps support for embedded-hal 0.2.7 but builds it on top of the implementation for embedded-hal 1.0

@sosthene-nitrokey sosthene-nitrokey merged commit 28afbe1 into embedded-hal-10 Sep 24, 2025
4 checks passed
@sosthene-nitrokey sosthene-nitrokey deleted the i2c-embedded-hal-10 branch September 24, 2025 15:37
Copy link
Contributor

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

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

Oh, I forgot to publish the question I had for this PR.

address: u8,
operations: &mut [embedded_hal::i2c::Operation<'_>],
) -> core::result::Result<(), Self::Error> {
let [ref mut current, ref mut rem @ ..] = operations else {
Copy link
Contributor

Choose a reason for hiding this comment

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

What’s the advantage of this syntax over split_first_mut?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None, I tend to use it because split_first_mut isn't really on my mind. split_first_mut is better readable though. I'll move to it.

@sosthene-nitrokey
Copy link
Contributor Author

sosthene-nitrokey commented Sep 25, 2025

Initially I wanted to review each individually but fixing the examples was hard with the stacked PRs.

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