Skip to content

Commit

Permalink
fix(dwc2) host driver conflict with max3421e
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Mar 6, 2025
1 parent 6bba410 commit 65e44e0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion examples/host/bare_api/src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@
// Enable Host stack
#define CFG_TUH_ENABLED 1

// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

#if CFG_TUSB_MCU == OPT_MCU_RP2040
// #define CFG_TUH_RPI_PIO_USB 1 // use pio-usb as host controller
// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

// host roothub port is 1 if using either pio-usb or max3421
#if (defined(CFG_TUH_RPI_PIO_USB) && CFG_TUH_RPI_PIO_USB) || (defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421)
Expand Down
3 changes: 2 additions & 1 deletion examples/host/cdc_msc_hid/src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@
// Enable Host stack
#define CFG_TUH_ENABLED 1

// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

#if CFG_TUSB_MCU == OPT_MCU_RP2040
// #define CFG_TUH_RPI_PIO_USB 1 // use pio-usb as host controller
// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

// host roothub port is 1 if using either pio-usb or max3421
#if (defined(CFG_TUH_RPI_PIO_USB) && CFG_TUH_RPI_PIO_USB) || (defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421)
Expand Down
3 changes: 2 additions & 1 deletion examples/host/cdc_msc_hid_freertos/src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@
// Enable Host stack
#define CFG_TUH_ENABLED 1

// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

#if CFG_TUSB_MCU == OPT_MCU_RP2040
// #define CFG_TUH_RPI_PIO_USB 1 // use pio-usb as host controller
// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

// host roothub port is 1 if using either pio-usb or max3421
#if (defined(CFG_TUH_RPI_PIO_USB) && CFG_TUH_RPI_PIO_USB) || (defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421)
Expand Down
3 changes: 2 additions & 1 deletion examples/host/device_info/src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@
// Enable Host stack
#define CFG_TUH_ENABLED 1

// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

#if CFG_TUSB_MCU == OPT_MCU_RP2040
// #define CFG_TUH_RPI_PIO_USB 1 // use pio-usb as host controller
// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

// host roothub port is 1 if using either pio-usb or max3421
#if (defined(CFG_TUH_RPI_PIO_USB) && CFG_TUH_RPI_PIO_USB) || (defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421)
Expand Down
3 changes: 2 additions & 1 deletion examples/host/hid_controller/src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@
// Enable Host stack
#define CFG_TUH_ENABLED 1

// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

#if CFG_TUSB_MCU == OPT_MCU_RP2040
// #define CFG_TUH_RPI_PIO_USB 1 // use pio-usb as host controller
// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

// host roothub port is 1 if using either pio-usb or max3421
#if (defined(CFG_TUH_RPI_PIO_USB) && CFG_TUH_RPI_PIO_USB) || (defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421)
Expand Down
3 changes: 2 additions & 1 deletion examples/host/msc_file_explorer/src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@
// Enable Host stack
#define CFG_TUH_ENABLED 1

// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

#if CFG_TUSB_MCU == OPT_MCU_RP2040
// #define CFG_TUH_RPI_PIO_USB 1 // use pio-usb as host controller
// #define CFG_TUH_MAX3421 1 // use max3421 as host controller

// host roothub port is 1 if using either pio-usb or max3421
#if (defined(CFG_TUH_RPI_PIO_USB) && CFG_TUH_RPI_PIO_USB) || (defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421)
Expand Down
2 changes: 1 addition & 1 deletion src/portable/synopsys/dwc2/hcd_dwc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "tusb_option.h"

#if CFG_TUH_ENABLED && defined(TUP_USBIP_DWC2)
#if CFG_TUH_ENABLED && defined(TUP_USBIP_DWC2) && !CFG_TUH_MAX3421

#if !(CFG_TUH_DWC2_SLAVE_ENABLE || CFG_TUH_DWC2_DMA_ENABLE)
#error DWC2 require either CFG_TUH_DWC2_SLAVE_ENABLE or CFG_TUH_DWC2_DMA_ENABLE to be enabled
Expand Down

0 comments on commit 65e44e0

Please sign in to comment.