Skip to content

Commit

Permalink
feat(usb_device_uac): support espressif/tinyusb 0.17.2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunru-hub committed Jan 17, 2025
1 parent eaa7262 commit 2fb1e40
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions components/usb/usb_device_uac/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## v1.1.0 (2025-1-15)

* Use espressif/tinyusb: 0.17.2

## v1.0.0 (2024-11-27)

* Release the official version.
Expand Down
10 changes: 9 additions & 1 deletion components/usb/usb_device_uac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ idf_component_register(SRCS usb_device_uac.c
INCLUDE_DIRS "include"
PRIV_REQUIRES usb esp_timer)

idf_component_get_property(tusb_lib leeebo__tinyusb_src COMPONENT_LIB)

# Determine whether tinyusb is fetched from component registry or from local path
idf_build_get_property(build_components BUILD_COMPONENTS)
if(tinyusb IN_LIST build_components)
set(tinyusb_name tinyusb) # Local component
else()
set(tinyusb_name espressif__tinyusb) # Managed component
endif()

idf_component_get_property(tusb_lib ${tinyusb_name} COMPONENT_LIB)
target_include_directories(${tusb_lib} PUBLIC "${COMPONENT_DIR}/tusb")
target_sources(${tusb_lib} PUBLIC "${COMPONENT_DIR}/tusb/usb_descriptors.c")

Expand Down
8 changes: 4 additions & 4 deletions components/usb/usb_device_uac/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.0"
version: "1.1.0"
targets:
- esp32s2
- esp32s3
Expand All @@ -11,9 +11,9 @@ repository: https://github.com/espressif/esp-iot-solution.git
issues: https://github.com/espressif/esp-iot-solution/issues

dependencies:
idf: ">=4.4"
leeebo/tinyusb_src:
version: ">=0.16.0~5"
idf: ">=5.0"
espressif/tinyusb:
version: "^0.17.0~2"
cmake_utilities: "*"
examples:
- path: ../../../examples/usb/device/usb_uac
Expand Down
4 changes: 2 additions & 2 deletions components/usb/usb_device_uac/tusb/uac_descriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ enum {
/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_MILLISEC, /*_lockdelay*/ 0x0001),\
/* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
TUD_AUDIO_DESC_STD_AS_ISO_FB_EP(/*_ep*/ _epfb, /*_interval*/TUD_OPT_HIGH_SPEED ? 4 : 1),\
TUD_AUDIO_DESC_STD_AS_ISO_FB_EP(/*_ep*/ _epfb, /*_epsize*/ 4, /*_interval*/TUD_OPT_HIGH_SPEED ? 4 : 1),\
/* Standard AS Interface Descriptor(4.9.1) */\
/* Interface 2, Alternate 0 - default alternate setting with 0 bandwidth */\
TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ _itfnum + 2, /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ _stridx + 2),\
Expand Down Expand Up @@ -266,7 +266,7 @@ enum {
/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_MILLISEC, /*_lockdelay*/ 0x0001),\
/* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
TUD_AUDIO_DESC_STD_AS_ISO_FB_EP(/*_ep*/ _epfb, /*_interval*/TUD_OPT_HIGH_SPEED ? 4 : 1)
TUD_AUDIO_DESC_STD_AS_ISO_FB_EP(/*_ep*/ _epfb, /*_epsize*/ 4, /*_interval*/TUD_OPT_HIGH_SPEED ? 4 : 1)
#endif

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion components/usb/usb_device_uac/usb_device_uac.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void tud_audio_feedback_params_cb(uint8_t func_id, uint8_t alt_itf, audio_feedba
feedback_param->method = AUDIO_FEEDBACK_METHOD_FIFO_COUNT;
feedback_param->sample_freq = s_uac_device->current_sample_rate;

ESP_LOGD(TAG, "Feedback method: %d, sample freq: %d", feedback_param->method, feedback_param->sample_freq);
ESP_LOGD(TAG, "Feedback method: %d, sample freq: %"PRIu32"", feedback_param->method, feedback_param->sample_freq);
}

// Helper for feature unit get requests
Expand Down

0 comments on commit 2fb1e40

Please sign in to comment.