rename tinyusb component config
This commit is contained in:
parent
a95c3112e9
commit
5d8504c851
|
@ -5,7 +5,7 @@ set(includes_public)
|
||||||
set(includes_private)
|
set(includes_private)
|
||||||
set(compile_options)
|
set(compile_options)
|
||||||
|
|
||||||
if(CONFIG_TINYUSB)
|
if(CONFIG_TINYUSB_DFU)
|
||||||
if(target STREQUAL "esp32s3")
|
if(target STREQUAL "esp32s3")
|
||||||
set(tusb_mcu "OPT_MCU_ESP32S3")
|
set(tusb_mcu "OPT_MCU_ESP32S3")
|
||||||
set(tusb_family "esp32sx")
|
set(tusb_family "esp32sx")
|
||||||
|
@ -13,7 +13,7 @@ if(CONFIG_TINYUSB)
|
||||||
set(tusb_mcu "OPT_MCU_ESP32S2")
|
set(tusb_mcu "OPT_MCU_ESP32S2")
|
||||||
set(tusb_family "esp32sx")
|
set(tusb_family "esp32sx")
|
||||||
else()
|
else()
|
||||||
# CONFIG_TINYUSB dependency has been garanteed by Kconfig logic,
|
# CONFIG_TINYUSB_DFU dependency has been garanteed by Kconfig logic,
|
||||||
# So it's not possible that cmake goes here
|
# So it's not possible that cmake goes here
|
||||||
message(FATAL_ERROR "TinyUSB is not support on ${target}.")
|
message(FATAL_ERROR "TinyUSB is not support on ${target}.")
|
||||||
return()
|
return()
|
||||||
|
@ -21,7 +21,7 @@ if(CONFIG_TINYUSB)
|
||||||
|
|
||||||
list(APPEND compile_options
|
list(APPEND compile_options
|
||||||
"-DCFG_TUSB_MCU=${tusb_mcu}"
|
"-DCFG_TUSB_MCU=${tusb_mcu}"
|
||||||
"-DCFG_TUSB_DEBUG=${CONFIG_TINYUSB_DEBUG_LEVEL}"
|
"-DCFG_TUSB_DEBUG=${CONFIG_TINYUSB_DFU_DEBUG_LEVEL}"
|
||||||
)
|
)
|
||||||
|
|
||||||
idf_component_get_property(freertos_component_dir freertos COMPONENT_DIR)
|
idf_component_get_property(freertos_component_dir freertos COMPONENT_DIR)
|
||||||
|
@ -60,15 +60,15 @@ if(CONFIG_TINYUSB)
|
||||||
# when no builtin class driver is enabled, an uint8_t data compared with `BUILTIN_DRIVER_COUNT` will always be false
|
# when no builtin class driver is enabled, an uint8_t data compared with `BUILTIN_DRIVER_COUNT` will always be false
|
||||||
set_source_files_properties("tinyusb/src/device/usbd.c" PROPERTIES COMPILE_FLAGS "-Wno-type-limits")
|
set_source_files_properties("tinyusb/src/device/usbd.c" PROPERTIES COMPILE_FLAGS "-Wno-type-limits")
|
||||||
|
|
||||||
if(CONFIG_TINYUSB_CDC_ENABLED)
|
if(CONFIG_TINYUSB_DFU_CDC_ENABLED)
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"additions/src/cdc.c"
|
"additions/src/cdc.c"
|
||||||
"additions/src/tusb_cdc_acm.c"
|
"additions/src/tusb_cdc_acm.c"
|
||||||
"additions/src/tusb_console.c"
|
"additions/src/tusb_console.c"
|
||||||
"additions/src/vfs_tinyusb.c"
|
"additions/src/vfs_tinyusb.c"
|
||||||
)
|
)
|
||||||
endif() # CONFIG_TINYUSB_CDC_ENABLED
|
endif() # CONFIG_TINYUSB_DFU_CDC_ENABLED
|
||||||
endif() # CONFIG_TINYUSB
|
endif() # CONFIG_TINYUSB_DFU
|
||||||
|
|
||||||
idf_component_register(SRCS ${srcs}
|
idf_component_register(SRCS ${srcs}
|
||||||
INCLUDE_DIRS ${includes_public}
|
INCLUDE_DIRS ${includes_public}
|
||||||
|
@ -76,6 +76,6 @@ idf_component_register(SRCS ${srcs}
|
||||||
PRIV_REQUIRES "vfs" "usb"
|
PRIV_REQUIRES "vfs" "usb"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CONFIG_TINYUSB)
|
if(CONFIG_TINYUSB_DFU)
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE ${compile_options})
|
target_compile_options(${COMPONENT_LIB} PRIVATE ${compile_options})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
menu "TinyUSB Stack"
|
menu "TinyUSB (with DFU) Stack"
|
||||||
visible if USB_OTG_SUPPORTED
|
visible if USB_OTG_SUPPORTED
|
||||||
|
|
||||||
config TINYUSB
|
config TINYUSB_DFU
|
||||||
bool "Use TinyUSB Stack"
|
bool "Use TinyUSB (with DFU) Stack"
|
||||||
depends on USB_OTG_SUPPORTED
|
depends on USB_OTG_SUPPORTED
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Enable TinyUSB stack support.
|
Enable TinyUSB stack support.
|
||||||
Note that, esp-idf only uses the device stack provided by TinyUSB.
|
Note that, esp-idf only uses the device stack provided by TinyUSB.
|
||||||
|
|
||||||
if TINYUSB
|
if TINYUSB_DFU
|
||||||
config TINYUSB_DEBUG_LEVEL
|
config TINYUSB_DFU_DEBUG_LEVEL
|
||||||
int "TinyUSB log level (0-3)"
|
int "TinyUSB log level (0-3)"
|
||||||
default 0
|
default 0
|
||||||
range 0 3
|
range 0 3
|
||||||
|
@ -18,96 +18,96 @@ menu "TinyUSB Stack"
|
||||||
Specify verbosity of TinyUSB log output.
|
Specify verbosity of TinyUSB log output.
|
||||||
|
|
||||||
menu "TinyUSB task configuration"
|
menu "TinyUSB task configuration"
|
||||||
config TINYUSB_NO_DEFAULT_TASK
|
config TINYUSB_DFU_NO_DEFAULT_TASK
|
||||||
bool "Do not create a TinyUSB task"
|
bool "Do not create a TinyUSB task"
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
This option allows to not create the FreeRTOS task during the driver initialization.
|
This option allows to not create the FreeRTOS task during the driver initialization.
|
||||||
User will have to handle TinyUSB events manually.
|
User will have to handle TinyUSB events manually.
|
||||||
|
|
||||||
config TINYUSB_TASK_PRIORITY
|
config TINYUSB_DFU_TASK_PRIORITY
|
||||||
int "TinyUSB task priority"
|
int "TinyUSB task priority"
|
||||||
default 5
|
default 5
|
||||||
depends on !TINYUSB_NO_DEFAULT_TASK
|
depends on !TINYUSB_DFU_NO_DEFAULT_TASK
|
||||||
help
|
help
|
||||||
Set the priority of the default TinyUSB main task.
|
Set the priority of the default TinyUSB main task.
|
||||||
|
|
||||||
config TINYUSB_TASK_STACK_SIZE
|
config TINYUSB_DFU_TASK_STACK_SIZE
|
||||||
int "TinyUSB task stack size (bytes)"
|
int "TinyUSB task stack size (bytes)"
|
||||||
default 4096
|
default 4096
|
||||||
depends on !TINYUSB_NO_DEFAULT_TASK
|
depends on !TINYUSB_DFU_NO_DEFAULT_TASK
|
||||||
help
|
help
|
||||||
Set the stack size of the default TinyUSB main task.
|
Set the stack size of the default TinyUSB main task.
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "Descriptor configuration"
|
menu "Descriptor configuration"
|
||||||
config TINYUSB_DESC_USE_ESPRESSIF_VID
|
config TINYUSB_DFU_DESC_USE_ESPRESSIF_VID
|
||||||
bool "VID: Use Espressif's vendor ID"
|
bool "VID: Use Espressif's vendor ID"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Enable this option, USB device will use Espressif's vendor ID as its VID.
|
Enable this option, USB device will use Espressif's vendor ID as its VID.
|
||||||
This is helpful at product develop stage.
|
This is helpful at product develop stage.
|
||||||
|
|
||||||
config TINYUSB_DESC_CUSTOM_VID
|
config TINYUSB_DFU_DESC_CUSTOM_VID
|
||||||
hex "VID: Custom vendor ID"
|
hex "VID: Custom vendor ID"
|
||||||
default 0x1234
|
default 0x1234
|
||||||
depends on !TINYUSB_DESC_USE_ESPRESSIF_VID
|
depends on !TINYUSB_DFU_DESC_USE_ESPRESSIF_VID
|
||||||
help
|
help
|
||||||
Custom Vendor ID.
|
Custom Vendor ID.
|
||||||
|
|
||||||
config TINYUSB_DESC_USE_DEFAULT_PID
|
config TINYUSB_DFU_DESC_USE_DEFAULT_PID
|
||||||
bool "PID: Use a default PID assigned to TinyUSB"
|
bool "PID: Use a default PID assigned to TinyUSB"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Default TinyUSB PID assigning uses values 0x4000...0x4007.
|
Default TinyUSB PID assigning uses values 0x4000...0x4007.
|
||||||
|
|
||||||
config TINYUSB_DESC_CUSTOM_PID
|
config TINYUSB_DFU_DESC_CUSTOM_PID
|
||||||
hex "PID: Custom product ID"
|
hex "PID: Custom product ID"
|
||||||
default 0x5678
|
default 0x5678
|
||||||
depends on !TINYUSB_DESC_USE_DEFAULT_PID
|
depends on !TINYUSB_DFU_DESC_USE_DEFAULT_PID
|
||||||
help
|
help
|
||||||
Custom Product ID.
|
Custom Product ID.
|
||||||
|
|
||||||
config TINYUSB_DESC_BCD_DEVICE
|
config TINYUSB_DFU_DESC_BCD_DEVICE
|
||||||
hex "bcdDevice"
|
hex "bcdDevice"
|
||||||
default 0x0100
|
default 0x0100
|
||||||
help
|
help
|
||||||
Version of the firmware of the USB device.
|
Version of the firmware of the USB device.
|
||||||
|
|
||||||
config TINYUSB_DESC_MANUFACTURER_STRING
|
config TINYUSB_DFU_DESC_MANUFACTURER_STRING
|
||||||
string "Manufacturer name"
|
string "Manufacturer name"
|
||||||
default "Espressif Systems"
|
default "Espressif Systems"
|
||||||
help
|
help
|
||||||
Name of the manufacturer of the USB device.
|
Name of the manufacturer of the USB device.
|
||||||
|
|
||||||
config TINYUSB_DESC_PRODUCT_STRING
|
config TINYUSB_DFU_DESC_PRODUCT_STRING
|
||||||
string "Product name"
|
string "Product name"
|
||||||
default "Espressif Device"
|
default "Espressif Device"
|
||||||
help
|
help
|
||||||
Name of the USB device.
|
Name of the USB device.
|
||||||
|
|
||||||
config TINYUSB_DESC_SERIAL_STRING
|
config TINYUSB_DFU_DESC_SERIAL_STRING
|
||||||
string "Serial string"
|
string "Serial string"
|
||||||
default "123456"
|
default "123456"
|
||||||
help
|
help
|
||||||
Serial number of the USB device.
|
Serial number of the USB device.
|
||||||
|
|
||||||
config TINYUSB_DESC_CDC_STRING
|
config TINYUSB_DFU_DESC_CDC_STRING
|
||||||
depends on TINYUSB_CDC_ENABLED
|
depends on TINYUSB_DFU_CDC_ENABLED
|
||||||
string "CDC Device String"
|
string "CDC Device String"
|
||||||
default "Espressif CDC Device"
|
default "Espressif CDC Device"
|
||||||
help
|
help
|
||||||
Name of the CDC device.
|
Name of the CDC device.
|
||||||
|
|
||||||
config TINYUSB_DESC_MSC_STRING
|
config TINYUSB_DFU_DESC_MSC_STRING
|
||||||
depends on TINYUSB_MSC_ENABLED
|
depends on TINYUSB_DFU_MSC_ENABLED
|
||||||
string "MSC Device String"
|
string "MSC Device String"
|
||||||
default "Espressif MSC Device"
|
default "Espressif MSC Device"
|
||||||
help
|
help
|
||||||
Name of the MSC device.
|
Name of the MSC device.
|
||||||
|
|
||||||
config TINYUSB_DESC_HID_STRING
|
config TINYUSB_DFU_DESC_HID_STRING
|
||||||
depends on TINYUSB_HID_ENABLED
|
depends on TINYUSB_DFU_HID_ENABLED
|
||||||
string "HID Device String"
|
string "HID Device String"
|
||||||
default "Espressif HID Device"
|
default "Espressif HID Device"
|
||||||
help
|
help
|
||||||
|
@ -115,14 +115,14 @@ menu "TinyUSB Stack"
|
||||||
endmenu # "Descriptor configuration"
|
endmenu # "Descriptor configuration"
|
||||||
|
|
||||||
menu "Massive Storage Class (MSC)"
|
menu "Massive Storage Class (MSC)"
|
||||||
config TINYUSB_MSC_ENABLED
|
config TINYUSB_DFU_MSC_ENABLED
|
||||||
bool "Enable TinyUSB MSC feature"
|
bool "Enable TinyUSB MSC feature"
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Enable TinyUSB MSC feature.
|
Enable TinyUSB MSC feature.
|
||||||
|
|
||||||
config TINYUSB_MSC_BUFSIZE
|
config TINYUSB_DFU_MSC_BUFSIZE
|
||||||
depends on TINYUSB_MSC_ENABLED
|
depends on TINYUSB_DFU_MSC_ENABLED
|
||||||
int "MSC FIFO size"
|
int "MSC FIFO size"
|
||||||
default 512
|
default 512
|
||||||
help
|
help
|
||||||
|
@ -130,26 +130,26 @@ menu "TinyUSB Stack"
|
||||||
endmenu # "Massive Storage Class"
|
endmenu # "Massive Storage Class"
|
||||||
|
|
||||||
menu "Communication Device Class (CDC)"
|
menu "Communication Device Class (CDC)"
|
||||||
config TINYUSB_CDC_ENABLED
|
config TINYUSB_DFU_CDC_ENABLED
|
||||||
bool "Enable TinyUSB CDC feature"
|
bool "Enable TinyUSB CDC feature"
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Enable TinyUSB CDC feature.
|
Enable TinyUSB CDC feature.
|
||||||
|
|
||||||
config TINYUSB_CDC_RX_BUFSIZE
|
config TINYUSB_DFU_CDC_RX_BUFSIZE
|
||||||
depends on TINYUSB_CDC_ENABLED
|
depends on TINYUSB_DFU_CDC_ENABLED
|
||||||
int "CDC FIFO size of RX channel"
|
int "CDC FIFO size of RX channel"
|
||||||
default 64
|
default 64
|
||||||
help
|
help
|
||||||
CDC FIFO size of RX channel.
|
CDC FIFO size of RX channel.
|
||||||
|
|
||||||
config TINYUSB_CDC_TX_BUFSIZE
|
config TINYUSB_DFU_CDC_TX_BUFSIZE
|
||||||
depends on TINYUSB_CDC_ENABLED
|
depends on TINYUSB_DFU_CDC_ENABLED
|
||||||
int "CDC FIFO size of TX channel"
|
int "CDC FIFO size of TX channel"
|
||||||
default 64
|
default 64
|
||||||
help
|
help
|
||||||
CDC FIFO size of TX channel.
|
CDC FIFO size of TX channel.
|
||||||
endmenu # "Communication Device Class"
|
endmenu # "Communication Device Class"
|
||||||
endif # TINYUSB
|
endif # TINYUSB_DFU
|
||||||
|
|
||||||
endmenu # "TinyUSB Stack"
|
endmenu # "TinyUSB Stack"
|
||||||
|
|
|
@ -33,24 +33,24 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_TINYUSB_CDC_ENABLED
|
#ifndef CONFIG_TINYUSB_DFU_CDC_ENABLED
|
||||||
# define CONFIG_TINYUSB_CDC_ENABLED 0
|
# define CONFIG_TINYUSB_DFU_CDC_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_TINYUSB_MSC_ENABLED
|
#ifndef CONFIG_TINYUSB_DFU_MSC_ENABLED
|
||||||
# define CONFIG_TINYUSB_MSC_ENABLED 0
|
# define CONFIG_TINYUSB_DFU_MSC_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_TINYUSB_HID_ENABLED
|
#ifndef CONFIG_TINYUSB_DFU_HID_ENABLED
|
||||||
# define CONFIG_TINYUSB_HID_ENABLED 0
|
# define CONFIG_TINYUSB_DFU_HID_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_TINYUSB_MIDI_ENABLED
|
#ifndef CONFIG_TINYUSB_DFU_MIDI_ENABLED
|
||||||
# define CONFIG_TINYUSB_MIDI_ENABLED 0
|
# define CONFIG_TINYUSB_DFU_MIDI_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED
|
#ifndef CONFIG_TINYUSB_DFU_CUSTOM_CLASS_ENABLED
|
||||||
# define CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED 0
|
# define CONFIG_TINYUSB_DFU_CUSTOM_CLASS_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE | OPT_MODE_FULL_SPEED
|
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE | OPT_MODE_FULL_SPEED
|
||||||
|
@ -76,21 +76,21 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// CDC FIFO size of TX and RX
|
// CDC FIFO size of TX and RX
|
||||||
#define CFG_TUD_CDC_RX_BUFSIZE CONFIG_TINYUSB_CDC_RX_BUFSIZE
|
#define CFG_TUD_CDC_RX_BUFSIZE CONFIG_TINYUSB_DFU_CDC_RX_BUFSIZE
|
||||||
#define CFG_TUD_CDC_TX_BUFSIZE CONFIG_TINYUSB_CDC_TX_BUFSIZE
|
#define CFG_TUD_CDC_TX_BUFSIZE CONFIG_TINYUSB_DFU_CDC_TX_BUFSIZE
|
||||||
|
|
||||||
// MSC Buffer size of Device Mass storage
|
// MSC Buffer size of Device Mass storage
|
||||||
#define CFG_TUD_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE
|
#define CFG_TUD_MSC_BUFSIZE CONFIG_TINYUSB_DFU_MSC_BUFSIZE
|
||||||
|
|
||||||
// HID buffer size Should be sufficient to hold ID (if any) + Data
|
// HID buffer size Should be sufficient to hold ID (if any) + Data
|
||||||
#define CFG_TUD_HID_BUFSIZE CONFIG_TINYUSB_HID_BUFSIZE
|
#define CFG_TUD_HID_BUFSIZE CONFIG_TINYUSB_DFU_HID_BUFSIZE
|
||||||
|
|
||||||
// Enabled device class driver
|
// Enabled device class driver
|
||||||
#define CFG_TUD_CDC CONFIG_TINYUSB_CDC_ENABLED
|
#define CFG_TUD_CDC CONFIG_TINYUSB_DFU_CDC_ENABLED
|
||||||
#define CFG_TUD_MSC CONFIG_TINYUSB_MSC_ENABLED
|
#define CFG_TUD_MSC CONFIG_TINYUSB_DFU_MSC_ENABLED
|
||||||
#define CFG_TUD_HID CONFIG_TINYUSB_HID_ENABLED
|
#define CFG_TUD_HID CONFIG_TINYUSB_DFU_HID_ENABLED
|
||||||
#define CFG_TUD_MIDI CONFIG_TINYUSB_MIDI_ENABLED
|
#define CFG_TUD_MIDI CONFIG_TINYUSB_DFU_MIDI_ENABLED
|
||||||
#define CFG_TUD_CUSTOM_CLASS CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED
|
#define CFG_TUD_CUSTOM_CLASS CONFIG_TINYUSB_DFU_CUSTOM_CLASS_ENABLED
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ esp_err_t tinyusb_driver_install(const tinyusb_config_t *config)
|
||||||
tusb_set_descriptor(dev_descriptor, string_descriptor);
|
tusb_set_descriptor(dev_descriptor, string_descriptor);
|
||||||
|
|
||||||
ESP_RETURN_ON_FALSE(tusb_init(), ESP_FAIL, TAG, "Init TinyUSB stack failed");
|
ESP_RETURN_ON_FALSE(tusb_init(), ESP_FAIL, TAG, "Init TinyUSB stack failed");
|
||||||
#if !CONFIG_TINYUSB_NO_DEFAULT_TASK
|
#if !CONFIG_TINYUSB_DFU_NO_DEFAULT_TASK
|
||||||
ESP_RETURN_ON_ERROR(tusb_run_task(), TAG, "Run TinyUSB task failed");
|
ESP_RETURN_ON_ERROR(tusb_run_task(), TAG, "Run TinyUSB task failed");
|
||||||
#endif
|
#endif
|
||||||
ESP_LOGI(TAG, "TinyUSB Driver installed");
|
ESP_LOGI(TAG, "TinyUSB Driver installed");
|
||||||
|
|
|
@ -103,7 +103,7 @@ void tud_cdc_rx_cb(uint8_t itf)
|
||||||
while (tud_cdc_n_available(itf)) {
|
while (tud_cdc_n_available(itf)) {
|
||||||
int read_res = tud_cdc_n_read( itf,
|
int read_res = tud_cdc_n_read( itf,
|
||||||
acm->rx_tfbuf,
|
acm->rx_tfbuf,
|
||||||
CONFIG_TINYUSB_CDC_RX_BUFSIZE );
|
CONFIG_TINYUSB_DFU_CDC_RX_BUFSIZE );
|
||||||
int res = xRingbufferSend(acm->rx_unread_buf,
|
int res = xRingbufferSend(acm->rx_unread_buf,
|
||||||
acm->rx_tfbuf,
|
acm->rx_tfbuf,
|
||||||
read_res, 0);
|
read_res, 0);
|
||||||
|
@ -396,7 +396,7 @@ esp_err_t tusb_cdc_acm_init(const tinyusb_config_cdcacm_t *cfg)
|
||||||
return ESP_ERR_NO_MEM;
|
return ESP_ERR_NO_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
acm->rx_tfbuf = malloc(CONFIG_TINYUSB_CDC_RX_BUFSIZE);
|
acm->rx_tfbuf = malloc(CONFIG_TINYUSB_DFU_CDC_RX_BUFSIZE);
|
||||||
if (!acm->rx_tfbuf) {
|
if (!acm->rx_tfbuf) {
|
||||||
ESP_LOGE(TAG, "Creation buffer error");
|
ESP_LOGE(TAG, "Creation buffer error");
|
||||||
free_obj(itf);
|
free_obj(itf);
|
||||||
|
|
|
@ -40,7 +40,7 @@ esp_err_t tusb_run_task(void)
|
||||||
// doing a sanity check anyway
|
// doing a sanity check anyway
|
||||||
ESP_RETURN_ON_FALSE(!s_tusb_tskh, ESP_ERR_INVALID_STATE, TAG, "TinyUSB main task already started");
|
ESP_RETURN_ON_FALSE(!s_tusb_tskh, ESP_ERR_INVALID_STATE, TAG, "TinyUSB main task already started");
|
||||||
// Create a task for tinyusb device stack:
|
// Create a task for tinyusb device stack:
|
||||||
xTaskCreate(tusb_device_task, "TinyUSB", CONFIG_TINYUSB_TASK_STACK_SIZE, NULL, CONFIG_TINYUSB_TASK_PRIORITY, &s_tusb_tskh);
|
xTaskCreate(tusb_device_task, "TinyUSB", CONFIG_TINYUSB_DFU_TASK_STACK_SIZE, NULL, CONFIG_TINYUSB_DFU_TASK_PRIORITY, &s_tusb_tskh);
|
||||||
ESP_RETURN_ON_FALSE(s_tusb_tskh, ESP_FAIL, TAG, "create TinyUSB main task failed");
|
ESP_RETURN_ON_FALSE(s_tusb_tskh, ESP_FAIL, TAG, "create TinyUSB main task failed");
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,19 +80,19 @@ tusb_desc_device_t descriptor_kconfig = {
|
||||||
|
|
||||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||||
|
|
||||||
#if CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID
|
#if CONFIG_TINYUSB_DFU_DESC_USE_ESPRESSIF_VID
|
||||||
.idVendor = USB_ESPRESSIF_VID,
|
.idVendor = USB_ESPRESSIF_VID,
|
||||||
#else
|
#else
|
||||||
.idVendor = CONFIG_TINYUSB_DESC_CUSTOM_VID,
|
.idVendor = CONFIG_TINYUSB_DFU_DESC_CUSTOM_VID,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_TINYUSB_DESC_USE_DEFAULT_PID
|
#if CONFIG_TINYUSB_DFU_DESC_USE_DEFAULT_PID
|
||||||
.idProduct = USB_TUSB_PID,
|
.idProduct = USB_TUSB_PID,
|
||||||
#else
|
#else
|
||||||
.idProduct = CONFIG_TINYUSB_DESC_CUSTOM_PID,
|
.idProduct = CONFIG_TINYUSB_DFU_DESC_CUSTOM_PID,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.bcdDevice = CONFIG_TINYUSB_DESC_BCD_DEVICE,
|
.bcdDevice = CONFIG_TINYUSB_DFU_DESC_BCD_DEVICE,
|
||||||
|
|
||||||
.iManufacturer = 0x01,
|
.iManufacturer = 0x01,
|
||||||
.iProduct = 0x02,
|
.iProduct = 0x02,
|
||||||
|
@ -104,24 +104,24 @@ tusb_desc_device_t descriptor_kconfig = {
|
||||||
tusb_desc_strarray_device_t descriptor_str_kconfig = {
|
tusb_desc_strarray_device_t descriptor_str_kconfig = {
|
||||||
// array of pointer to string descriptors
|
// array of pointer to string descriptors
|
||||||
(char[]){0x09, 0x04}, // 0: is supported language is English (0x0409)
|
(char[]){0x09, 0x04}, // 0: is supported language is English (0x0409)
|
||||||
CONFIG_TINYUSB_DESC_MANUFACTURER_STRING, // 1: Manufacturer
|
CONFIG_TINYUSB_DFU_DESC_MANUFACTURER_STRING, // 1: Manufacturer
|
||||||
CONFIG_TINYUSB_DESC_PRODUCT_STRING, // 2: Product
|
CONFIG_TINYUSB_DFU_DESC_PRODUCT_STRING, // 2: Product
|
||||||
CONFIG_TINYUSB_DESC_SERIAL_STRING, // 3: Serials, should use chip ID
|
CONFIG_TINYUSB_DFU_DESC_SERIAL_STRING, // 3: Serials, should use chip ID
|
||||||
|
|
||||||
#if CONFIG_TINYUSB_CDC_ENABLED
|
#if CONFIG_TINYUSB_DFU_CDC_ENABLED
|
||||||
CONFIG_TINYUSB_DESC_CDC_STRING, // 4: CDC Interface
|
CONFIG_TINYUSB_DFU_DESC_CDC_STRING, // 4: CDC Interface
|
||||||
#else
|
#else
|
||||||
"",
|
"",
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_TINYUSB_MSC_ENABLED
|
#if CONFIG_TINYUSB_DFU_MSC_ENABLED
|
||||||
CONFIG_TINYUSB_DESC_MSC_STRING, // 5: MSC Interface
|
CONFIG_TINYUSB_DFU_DESC_MSC_STRING, // 5: MSC Interface
|
||||||
#else
|
#else
|
||||||
"",
|
"",
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_TINYUSB_HID_ENABLED
|
#if CONFIG_TINYUSB_DFU_HID_ENABLED
|
||||||
CONFIG_TINYUSB_DESC_HID_STRING // 6: HIDs
|
CONFIG_TINYUSB_DFU_DESC_HID_STRING // 6: HIDs
|
||||||
#else
|
#else
|
||||||
"",
|
"",
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
# sdkconfig replacement configurations for deprecated options formatted as
|
# sdkconfig replacement configurations for deprecated options formatted as
|
||||||
# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION
|
# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION
|
||||||
CONFIG_USB_ENABLED CONFIG_TINYUSB
|
CONFIG_USB_ENABLED CONFIG_TINYUSB_DFU
|
||||||
CONFIG_USB_DO_NOT_CREATE_TASK CONFIG_TINYUSB_NO_DEFAULT_TASK
|
CONFIG_USB_DO_NOT_CREATE_TASK CONFIG_TINYUSB_DFU_NO_DEFAULT_TASK
|
||||||
CONFIG_USB_TASK_PRIORITY CONFIG_TINYUSB_TASK_PRIORITY
|
CONFIG_USB_TASK_PRIORITY CONFIG_TINYUSB_DFU_TASK_PRIORITY
|
||||||
CONFIG_USB_DESC_USE_ESPRESSIF_VID CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID
|
CONFIG_USB_DESC_USE_ESPRESSIF_VID CONFIG_TINYUSB_DFU_DESC_USE_ESPRESSIF_VID
|
||||||
CONFIG_USB_DESC_CUSTOM_VID CONFIG_TINYUSB_DESC_CUSTOM_VID
|
CONFIG_USB_DESC_CUSTOM_VID CONFIG_TINYUSB_DFU_DESC_CUSTOM_VID
|
||||||
CONFIG_USB_DESC_USE_DEFAULT_PID CONFIG_TINYUSB_DESC_USE_DEFAULT_PID
|
CONFIG_USB_DESC_USE_DEFAULT_PID CONFIG_TINYUSB_DFU_DESC_USE_DEFAULT_PID
|
||||||
CONFIG_USB_DESC_CUSTOM_PID CONFIG_TINYUSB_DESC_CUSTOM_PID
|
CONFIG_USB_DESC_CUSTOM_PID CONFIG_TINYUSB_DFU_DESC_CUSTOM_PID
|
||||||
CONFIG_USB_DESC_BCDDEVICE CONFIG_TINYUSB_DESC_BCD_DEVICE
|
CONFIG_USB_DESC_BCDDEVICE CONFIG_TINYUSB_DFU_DESC_BCD_DEVICE
|
||||||
CONFIG_USB_DESC_MANUFACTURER_STRING CONFIG_TINYUSB_DESC_MANUFACTURER_STRING
|
CONFIG_USB_DESC_MANUFACTURER_STRING CONFIG_TINYUSB_DFU_DESC_MANUFACTURER_STRING
|
||||||
CONFIG_USB_DESC_PRODUCT_STRING CONFIG_TINYUSB_DESC_PRODUCT_STRING
|
CONFIG_USB_DESC_PRODUCT_STRING CONFIG_TINYUSB_DFU_DESC_PRODUCT_STRING
|
||||||
CONFIG_USB_DESC_SERIAL_STRING CONFIG_TINYUSB_DESC_SERIAL_STRING
|
CONFIG_USB_DESC_SERIAL_STRING CONFIG_TINYUSB_DFU_DESC_SERIAL_STRING
|
||||||
CONFIG_USB_DESC_CDC_STRING CONFIG_TINYUSB_DESC_CDC_STRING
|
CONFIG_USB_DESC_CDC_STRING CONFIG_TINYUSB_DFU_DESC_CDC_STRING
|
||||||
CONFIG_USB_DESC_MSC_STRING CONFIG_TINYUSB_DESC_MSC_STRING
|
CONFIG_USB_DESC_MSC_STRING CONFIG_TINYUSB_DFU_DESC_MSC_STRING
|
||||||
CONFIG_USB_DESC_HID_STRING CONFIG_TINYUSB_DESC_HID_STRING
|
CONFIG_USB_DESC_HID_STRING CONFIG_TINYUSB_DFU_DESC_HID_STRING
|
||||||
CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED
|
CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_DFU_MSC_ENABLED
|
||||||
CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE
|
CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_DFU_MSC_BUFSIZE
|
||||||
CONFIG_USB_CDC_ENABLED CONFIG_TINYUSB_CDC_ENABLED
|
CONFIG_USB_CDC_ENABLED CONFIG_TINYUSB_DFU_CDC_ENABLED
|
||||||
CONFIG_USB_CDC_RX_BUFSIZE CONFIG_TINYUSB_CDC_RX_BUFSIZE
|
CONFIG_USB_CDC_RX_BUFSIZE CONFIG_TINYUSB_DFU_CDC_RX_BUFSIZE
|
||||||
CONFIG_USB_CDC_TX_BUFSIZE CONFIG_TINYUSB_CDC_TX_BUFSIZE
|
CONFIG_USB_CDC_TX_BUFSIZE CONFIG_TINYUSB_DFU_CDC_TX_BUFSIZE
|
||||||
CONFIG_USB_DEBUG_LEVEL CONFIG_TINYUSB_DEBUG_LEVEL
|
CONFIG_USB_DEBUG_LEVEL CONFIG_TINYUSB_DFU_DEBUG_LEVEL
|
||||||
|
|
Loading…
Reference in New Issue