Skip to content

Commit

Permalink
Merge pull request #2296 from LarssonOliver/master
Browse files Browse the repository at this point in the history
Allow external definition of TU_CP210X_PID_LIST
  • Loading branch information
hathach authored Dec 11, 2023
2 parents 71f1400 + c4e04d3 commit 4c80f5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/class/cdc/cdc_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static bool ftdi_sio_set_baudrate(cdch_interface_t* p_cdc, uint32_t baudrate, tu
#if CFG_TUH_CDC_CP210X
#include "serial/cp210x.h"

static uint16_t const cp210x_pids[] = { TU_CP210X_PID_LIST };
static uint16_t const cp210x_pids[] = { CFG_TUH_CDC_CP210X_PID_LIST };
enum {
CP210X_PID_COUNT = sizeof(cp210x_pids) / sizeof(cp210x_pids[0])
};
Expand Down
2 changes: 0 additions & 2 deletions src/class/cdc/serial/cp210x.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
// https://www.silabs.com/documents/public/application-notes/AN571.pdf

#define TU_CP210X_VID 0x10C4
#define TU_CP210X_PID_LIST \
0xEA60, 0xEA70

/* Config request codes */
#define CP210X_IFC_ENABLE 0x00
Expand Down
6 changes: 6 additions & 0 deletions src/tusb_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@
#define CFG_TUH_CDC_CP210X 0
#endif

#ifndef CFG_TUH_CDC_CP210X_PID_LIST
// List of product IDs that can use the CP210X CDC driver
#define CFG_TUH_CDC_CP210X_PID_LIST \
0xEA60, 0xEA70
#endif

#ifndef CFG_TUH_HID
#define CFG_TUH_HID 0
#endif
Expand Down

0 comments on commit 4c80f5a

Please sign in to comment.