-
Notifications
You must be signed in to change notification settings - Fork 367
No longer publicly expose the PeripheralClockControl struct
#817
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
Conversation
MabezDev
left a comment
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.
one nit pick, but LGTM otherwise!
|
Probably enable for targets other than C6/H2 should be done in a critical section since at least in theory it could get interrupted between reading a register and writing it. If in an interrupt another peripheral gets enabled we might write back a bad value Not very likely t.b.h. but at least we don't prevent it anymore |
|
Sorry I'm not quite sure I follow, what do you mean by "we don't prevent it anymore"? What were we doing before exactly that we're not doing now? |
|
Before the user had to pass a mutable reference to SystemClockControl - there can be always only one at a time so access had to be serialized before Maybe there is already something to prevent it in this PR ... using a smartphone right now - not ideal to look at this amount of changes |
|
Oh I see what you mean now, sorry about that. |
The desktop page doesn't work much better either :D, so laggy. |
|
Thank you. This should fix #776 |
|
I always appreciate changes where the update process is one step:
I'd love to try this in my project, but unfortunately, I am unable to because of two separate build errors introduced recently into the HAL. (#818) |
bjoernQ
left a comment
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.
LGTM - I still think there should be a critical-section for non C6/H2 however
… they modify multiple registers
6f0ceeb to
6c28784
Compare
I have been meaning to do this for some time now, finally got around to it.
Rather than exposing the
PeripheralClockControlstruck via theSystemPartsstruct, the drivers just handle this all internally. SincePeripheralClockControlwas already a ZST, I've just removed the&mut selfargument of theenablefunction and instead converted it to an associated function. This type's scope was also limited to the crate-level.This is obviously a pretty breaking change, but it's more than worth it IMO.
These changes were pretty straight forward, but also fairly invasive, so hopefully I haven't broken anything! If anybody has any questions/concerns/suggestions please let me know!
Closes #776