rp2040: don't compile in host code when in device mode#676
Merged
Conversation
liamfraser
approved these changes
Feb 25, 2021
hathach
reviewed
Feb 25, 2021
Owner
hathach
left a comment
There was a problem hiding this comment.
since it is approved by RPi team, I think it is good to merge, though I think we could merge line 74 and 89 together for easier reading.
| uint len; | ||
| // Amount of data with the hardware | ||
| uint transfer_size; | ||
| #ifdef RP2040_USB_HOST_MODE |
Owner
There was a problem hiding this comment.
if the field order is not matter, we should merge this with line 89 into a single #ifdef
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.
Presently, there is assorted host-only rp2040 code that gets compiled into device-only operation. (Host and device modes are mutually exclusive.) Making this host-only code conditional at compile time saves code and data space.
This PR alone is good for 272 fewer bytes of code and 128 bytes less data RAM consumed.