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

Upgrade to embedded-hal 1.0.0 #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mdaffin
Copy link

@mdaffin mdaffin commented Jan 4, 2025

There was one breaking change that will propergate to a breaking change for end users. CountDown is no longer a trait in embedded_hal 1 and there is no replacment. There are two main paths we could take here: using the CountDown timer from rp2040-hal crate or convert to DelayNs which is what embedded_hal suggested since we only actually use it for a 60micro second delay. This does mean that you need to pass in the Timer instance rather than a CountDown instead but overall keeps the code a bit more generic and requires fewer trait bounds.

It would be nice to rename the generics from C to T as they really now represent the Timer rather than CountDown but T is already used by some iterators later on and renaming those to I conflicts with other generics - so i opted to avoid the renaming bikeshedding in this completely.

There was one breaking change that will propergate to a breaking change for end users. CountDown is no longer a trait in embedded_hal 1 and there is no replacment. There are two main paths we could take here: using the CountDown timer from rp2040-hal crate or convert to DelayNs which is what embedded_hal suggested since we only actually use it for a 60micro second delay. This does mean that you need to pass in the Timer instance rather than a CountDown instead but overall keeps the code a bit more generic and requires fewer trait bounds.

It would be nice to rename the generics from C to T as they really now represent the Timer rather than CountDown but T is already used by some iterators later on and renaming those to I conflicts with other generics - so i opted to avoid the renaming bikeshedding in this completely.
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.

1 participant