Skip to content

add rp2040 to host example build#684

Merged
hathach merged 2 commits into
masterfrom
rp2040-host-example
Mar 2, 2021
Merged

add rp2040 to host example build#684
hathach merged 2 commits into
masterfrom
rp2040-host-example

Conversation

@hathach
Copy link
Copy Markdown
Owner

@hathach hathach commented Feb 26, 2021

Describe the PR
Add RP2040 to host example build. Also change ifdef RP2040_USB_HOST_MODE to if TUSB_OPT_HOST_ENABLED to be consistent with tinyusb host detection convention.

@hathach hathach requested a review from liamfraser February 26, 2021 07:07
${TOP}/src/portable/raspberrypi/${FAMILY}/rp2040_usb.c
${TOP}/src/portable/raspberrypi/${FAMILY}/dcd_rp2040.c
${TOP}/src/portable/raspberrypi/${FAMILY}/hcd_rp2040.c
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have split our cmake into a device and host mode so you don't unnecessarily compile both.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Owner Author

@hathach hathach Feb 27, 2021

Choose a reason for hiding this comment

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

That is ok though, tinyusb is designed to be all included and controlled by config file. To be honest that make my example easier 😄

PS: also there may be dual role example later on, often is use to detect whether board is connected to pc or accessories using ID pin.

CFG_TUSB_OS=OPT_OS_PICO
)

target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The USB device enumeration fix only applies to device mode. Perhaps this should be linked in by family.cmake?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

It is ok as well, since the code is not run anyway, as above. There may be otg example later on

@hathach hathach merged commit 559ff80 into master Mar 2, 2021
@hathach hathach deleted the rp2040-host-example branch March 2, 2021 06:03
7FM pushed a commit to 7FM/tinyusb that referenced this pull request Aug 23, 2025
* added board header for adafruit macropad rp2040

Co-authored-by: Daniel Kenyon-Jones <mail@dlkj.co.uk>
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.

2 participants