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

Unified how pins are return in free calls #372

Merged
merged 6 commits into from
Jan 12, 2022

Conversation

korken89
Copy link
Contributor

@korken89 korken89 commented Jan 7, 2022

Hi,

I unified so pins are returned the same for all peripherals.

Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

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

I wonder if it would be beneficial to add a free method that only returns the peripheral, for efficiency (the added volatile reads add to code size). Presumably users would almost always want the pins back though?

nrf-hal-common/src/pwm.rs Outdated Show resolved Hide resolved
@korken89
Copy link
Contributor Author

I wonder if it would be beneficial to add a free method that only returns the peripheral, for efficiency (the added volatile reads add to code size). Presumably users would almost always want the pins back though?

If there should be a free without the pins, to me it does not make sense to not get back all the hardware that was used.
The efficiency loss here are 4 register reads worst case, so the overhead does not seem like an issue to me. Would you agree?

@korken89
Copy link
Contributor Author

There, it should be ready for a re-review now @jonas-schievink

@korken89 korken89 force-pushed the unify-free-pins branch 2 times, most recently from 16aa04c to 902650b Compare January 12, 2022 12:40
Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
@jonas-schievink
Copy link
Contributor

bors r+

@bors bors bot merged commit 577a9f3 into nrf-rs:master Jan 12, 2022
@bors
Copy link
Contributor

bors bot commented Jan 12, 2022

Build succeeded:

@korken89 korken89 deleted the unify-free-pins branch January 12, 2022 17:09
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.

None yet

2 participants