-
Notifications
You must be signed in to change notification settings - Fork 238
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
Make embedded-hal 1.0.0 non-optional #753
Conversation
Shall we make eh1 the embedded_hal and rename 0.2 as embedded_hal_02 ? When we introduce async, should we make it optional or not? |
If you make async optional it should be enabled by default IMO. And I agree that v1 should just be |
We should just include it unconditionally. There is no benefit to having it optional.
It makes no difference to the HAL or it's users what the dependencies are called internally. It only matters that we implement the traits in the HAL so that drivers that depend on those trait versions work. |
I also think there's no reason to make async optional. It should be possible to implement it in a way that has minimal if async is not used in a firmware. (There is some impact because of additional dependencies which will increase compilation time. I'd hope that this increase won't be significant.) Regarding the internal naming: That's one of the possible cleanups I was thinking about. Not critical because it should not affect the API, but we still should aim for well readable code within the HAL. |
I looked into renaming |
I updated several files to use the eh-1 traits without renaming, and instead rename the eh-0.2 if there are conflicts. It kept the commits nicely separated, so it's easy to move these changes to their own PR in case you prefer to merge the minimal change first. |
Adds notes where this isn't (yet) possible. This also involved adding an inherent method to PWM Channels, so you can enable or disable them without using the old trait.
I propose changing the examples to use the new traits by default. Basically, you shouldn't have to know about the 0.2 traits unless you need the backwards-compatibility. See https://github.com/rp-rs/rp-hal/tree/extra-1_0-impls. |
Yes, definitely! |
If you like my proposal, please do merge it into your branch, so we get can it into main in one hit. I thought this was easier than a million |
I find that little and often is a good policy, and this PR is already large, so I think we should merge it and then work on more clean-up stuff later. In particular, we need this in so we can rebase the I2C changes over it, and we then need to work on embedded-io support for the serial ports. |
Definitely. That's why I marked the pull request as ready for review 3 days ago. (Sorry, I forgot to update the top comment accordingly.) |
Embedded-hal 0.2 trait impls are now wrappers for inherent functions
Marked as draft because I still have to check if the code needs some clean-up.