usbdev: Add low level initialization to periph_init()#11213
Merged
dylad merged 2 commits intoRIOT-OS:masterfrom Mar 25, 2019
Merged
usbdev: Add low level initialization to periph_init()#11213dylad merged 2 commits intoRIOT-OS:masterfrom
periph_init()#11213dylad merged 2 commits intoRIOT-OS:masterfrom
Conversation
dylad
reviewed
Mar 20, 2019
| * | ||
| * @returns the usbdev context at index @p num | ||
| */ | ||
| usbdev_t *usbdev_get_ctx(unsigned num); |
Member
Author
There was a problem hiding this comment.
I'd rather keep this unsigned( or unsigned int). The size here doesn't really matter, I'd be suprised to see an mcu with more than 255 USB peripherals. With this in mind I'd like to leave it up to the platform to pick a decent size.
Member
|
@bergzand Are you done here ? I'd like to merge it before feature freezes. |
Member
Author
haukepetersen
approved these changes
Mar 25, 2019
Contributor
haukepetersen
left a comment
There was a problem hiding this comment.
looks good to me -> ACK
Member
|
Here we go ! |
Member
Author
|
@dylad Thanks for testing! |
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
This PR adds low level initialization functions for
usbdev. A low level init function is added to be called inperiph_init(). This should prepare any configured usbdev device available on the mcu for the real initialization call. Most of this is going to be hooking up the right driver struct with the right context.The other function is added to allow for retrieving a usbdev context. this is similar to the already existing
SPI_DEV()andI2C_DEV()macros.Both of these functions must be implemented by the cpu-specific usbdev periph code.
Testing procedure
Must not impact anything normally as there is no board providing
periph_usbdevyet. Withperiph_usbdevthis should cause a linker error for a missing implementation ofusbdev_init_lowlevel()Issues/PRs references
fixes a chicken/egg issue with the current usb PR set.