Skip to content

Commit

Permalink
Add support for two TinyUSB CDC devices at once (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev authored Feb 12, 2025
1 parent ad3fb24 commit 37d69ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
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

0 comments on commit 37d69ca

Please sign in to comment.