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

Add additional Bazel config tinyUSB and pico_stdio_usb #2264

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mbrase
Copy link

@mbrase mbrase commented Feb 13, 2025

This change the makes the following defines setable in Bazel:

  • LIB_TINYUSB_HOST
  • LIB_TINYUSB_DEVICE
  • PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE
  • PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE

This also adds //bazel/config:PICO_TINYUSB_CONFIG, which allows overriding the "tusb_config.h" header used to build tinyUSB. This might be used to add additional USB interfaces while preserving the functionality from pico_stdio_usb.

@kilograham
Copy link
Contributor

cc @armandomontanez

@kilograham kilograham added this to the 2.1.2 milestone Feb 15, 2025
@mbrase
Copy link
Author

mbrase commented Feb 15, 2025

I chatted with @armandomontanez on Friday and I'm going to upload a narrower patch based on his feedback.

@mbrase
Copy link
Author

mbrase commented Feb 18, 2025

I've uploaded a new patch which is a subset of the previous patch

Add Bazel label flag for overriding tusb_config.h

This adds //bazel/config:PICO_TINYUSB_CONFIG, which is used to select
which tusb_config.h gets linked into the tinyUSB port. This defaults to
the tusb_config.h from the pico_stdio_usb (same as before), but allows
Bazel users to override this config with their own.

@mbrase mbrase changed the title Add additional Bazel defines for tinyUSB and pico_stdio_usb Add additional Bazel config tinyUSB and pico_stdio_usb Feb 18, 2025
This adds `//bazel/config:PICO_TINYUSB_CONFIG`, which is used to select
which tusb_config.h gets linked into the tinyUSB port. This defaults to
the tusb_config.h from the pico_stdio_usb (same as before), but allows
Bazel users to override this config with their own.
@mbrase
Copy link
Author

mbrase commented Feb 24, 2025

Hi, I'm ready for this to be reviewed

@@ -43,10 +46,6 @@ cc_library(
hdrs = ["include/pico/stdio_usb.h"],
includes = ["include"],
target_compatible_with = compatible_with_rp2(),
visibility = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Publicly exposing this is a little unfortunate, but it's probably the only path forward anyway.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I wanted to include the stdio_usb.h in my tusb_config.h, much like the default tusb_config.h does, and I need the header only target to avoid a circular dependency.

@armandomontanez
Copy link
Contributor

Bazel changes look good to me, sorry for the dealy.

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.

3 participants