usb: Extend CDC device with second CDC channel

Closes https://github.com/espressif/esp-idf/issues/7020
Closes https://github.com/espressif/esp-idf/pull/8011
This commit is contained in:
Tomas Rezucha
2021-12-16 07:50:08 +01:00
parent fa8364a544
commit 6330d5d312
29 changed files with 115 additions and 164 deletions

View File

@@ -7,6 +7,13 @@
#include "usb_descriptors.h"
#include "sdkconfig.h"
/*
* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
* Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
*
* Auto ProductID layout's Bitmap:
* [MSB] HID | MSC | CDC [LSB]
*/
#define USB_TUSB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | _PID_MAP(MIDI, 3))
/**** TinyUSB default ****/