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

Remove Deref from peripheral singletons #2956

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Jan 14, 2025

This PR removes the Deref implementation from peripheral singletons. Instead, a register_block(&self) and a regs() method (both of them public-unstable) are provided by the peripheral singletons. Drivers usually wrap these in a .regs(&self). This change removes stable exposure of PAC types through the Deref trait.

cc #2525

@bugadani bugadani added the skip-changelog No changelog modification needed label Jan 14, 2025
@bugadani bugadani force-pushed the peripheral branch 4 times, most recently from 0a8a879 to 7deaba6 Compare January 15, 2025 08:38
@bugadani bugadani marked this pull request as draft January 15, 2025 08:49
@bugadani bugadani force-pushed the peripheral branch 2 times, most recently from f64e0e6 to 62d7531 Compare January 15, 2025 09:31
@bugadani bugadani force-pushed the peripheral branch 5 times, most recently from 5efbe85 to 55db8da Compare January 20, 2025 13:06
@bugadani bugadani marked this pull request as ready for review January 20, 2025 13:24
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks! Left a small detail that can be ignored.

Also, we discourage abbreviations, are we ok with regs? I think is well understood, but just in case, I bring it up.

esp-hal/src/rtc_cntl/rtc/esp32c6.rs Outdated Show resolved Hide resolved
@MabezDev
Copy link
Member

Also, we discourage abbreviations, are we ok with regs? I think is well understood, but just in case, I bring it up.

Thanks for bringing that up! I think this abbreviation is fine in this instance.

@MabezDev MabezDev added this pull request to the merge queue Jan 21, 2025
@bugadani bugadani removed this pull request from the merge queue due to a manual request Jan 21, 2025
@bugadani bugadani enabled auto-merge January 21, 2025 13:53
@bugadani bugadani added this pull request to the merge queue Jan 21, 2025
Merged via the queue into esp-rs:main with commit 537829d Jan 21, 2025
28 checks passed
@bugadani bugadani deleted the peripheral branch January 21, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants