drivers/at86rf2xx: don't copy params to RAM#12712
Closed
benpicco wants to merge 1 commit intoRIOT-OS:masterfrom
Closed
drivers/at86rf2xx: don't copy params to RAM#12712benpicco wants to merge 1 commit intoRIOT-OS:masterfrom
benpicco wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
The params struct is not changed, so there is no point in copying it to RAM. This uses 44 bytes *more* ROM and 16 bytes *less* RAM.
Member
|
Some cons:
However: I have no strong opinion on this. Code-wise and documentation-wise this is objectively fine. |
Member
|
I let others decide on whether the trade-off is worth it. |
Contributor
Author
|
Yea I posted this more as a basis for discussion. ATmega128RFA1/ATmega256RFR2 doesn't use that struct, but with beforeafterSo it's really not worth it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
The
paramsstruct is not changed at run-time, so there is no point in copying it to RAM.With the
gnrc_networkingonsamr21-xprothe difference is rather negligible though:This uses 44 bytes more ROM and 16 bytes less RAM.
before
after
Testing procedure
I ran
gnrc_networkingand did not notice a difference in behavior.Issues/PRs references
Came up in #12641 when discussing if it's possible to find out the index of a netdev in the
at86rf215_params[]array.