-
-
Notifications
You must be signed in to change notification settings - Fork 779
chips: nrf5x: forbid unsafe #4626
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is doing a lot much which seems pretty undesirable to me, particularly moving a lot of functionality that should be the responsibility of a chip into the board.
I'd advocate for this being converted to a draft PR, as potentially a basis for discussion of whether/which features should move where to enable no-unsafe or minimize unsafe in certain chip crates.
Moreover, merging a design pattern change like this whole cloth for just one chip, rather than more targeted parts of the design pattern across all chips, seems worse to me. It means chip-developers are going to end up with conflicting sources for what responsibilities each component should have.
This would be very helpful. This PR only changes boards in two ways:
Questions for designs:
|
Changing all chips is hard. And harder to test. I would advocate for converting the nrf5 stack into the beacon example, writing docs around that example, and then telling people that is the example. |
|
As a sidenote, I'm glad to see the Nrf5x aes implementation updated to use a |
Unfortunately I'm pretty sure it still is, but hopefully this is easier to fix whenever |
Pull Request Overview
This pull request converts the nrf5x crate to be forbid unsafe. This is in some ways an example of what it might look like to try to split our chip crates into safe and unsafe, with all of the drivers moved to safe, and the instantiations in unsafe.
There are hidden
static mutin the nrf5x crate which I removed. The AES change was bigger than anticipated and needs testing.I removed the pinmux check. Having a global variable for that runtime check does not seem worth it.
Testing Strategy
todo
TODO or Help Wanted
n/a
Documentation Updated
/docs, or no updates are required.Formatting
make prepush.