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 support for two TinyUSB CDC devices at once #275

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions components/arduino_tinyusb/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ menu "Arduino TinyUSB"
help
CDC FIFO size of TX

config TINYUSB_CDC_MAX_PORTS
int "Maximum enabled CDC ports"
range 1 2
default 1
depends on TINYUSB_CDC_ENABLED
help
Maximum enabled CDC ports

endmenu

menu "Mass Storage (MSC) driver"
Expand Down
6 changes: 5 additions & 1 deletion components/arduino_tinyusb/include/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ extern "C" {
#define CFG_TUD_ENDOINT0_SIZE 64

// Enabled Drivers
#define CFG_TUD_CDC CONFIG_TINYUSB_CDC_ENABLED
#ifdef CONFIG_TINYUSB_CDC_MAX_PORTS
#define CFG_TUD_CDC CONFIG_TINYUSB_CDC_MAX_PORTS
#else
#define CFG_TUD_CDC 0
#endif
#define CFG_TUD_MSC CONFIG_TINYUSB_MSC_ENABLED
#define CFG_TUD_HID CONFIG_TINYUSB_HID_ENABLED
#define CFG_TUD_MIDI CONFIG_TINYUSB_MIDI_ENABLED
Expand Down
3 changes: 3 additions & 0 deletions configs/defconfig.common
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@ CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n
CONFIG_ENABLE_ESP_INSIGHTS_TRACE=n
# Use compact attribute storage mode
CONFIG_ESP_MATTER_NVS_USE_COMPACT_ATTR_STORAGE=y

#TinyUSB Config
CONFIG_TINYUSB_CDC_MAX_PORTS=2