Skip to content

Commit d89fc07

Browse files
committed
add makefile, add cdc_uac2 to cmake example list, update descriptor to build with nrf and samg/7x
1 parent 6844055 commit d89fc07

File tree

7 files changed

+37
-60
lines changed

7 files changed

+37
-60
lines changed

examples/device/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ family_add_subdirectory(board_test)
1313
family_add_subdirectory(cdc_dual_ports)
1414
family_add_subdirectory(cdc_msc)
1515
family_add_subdirectory(cdc_msc_freertos)
16+
family_add_subdirectory(cdc_uac2)
1617
family_add_subdirectory(dfu)
1718
family_add_subdirectory(dfu_runtime)
1819
family_add_subdirectory(dynamic_configuration)

examples/device/cdc_uac2/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ add_executable(${PROJECT})
1919

2020
# Example source
2121
target_sources(${PROJECT} PUBLIC
22-
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
23-
${CMAKE_CURRENT_SOURCE_DIR}/src/tusb_cdc.c
24-
${CMAKE_CURRENT_SOURCE_DIR}/src/tusb_uac2.c
25-
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
26-
)
22+
${CMAKE_CURRENT_SOURCE_DIR}/src/cdc_app.c
23+
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
24+
${CMAKE_CURRENT_SOURCE_DIR}/src/uac2_app.c
25+
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
26+
)
2727

2828
# Example include
2929
target_include_directories(${PROJECT} PUBLIC
30-
${CMAKE_CURRENT_SOURCE_DIR}/src
31-
)
30+
${CMAKE_CURRENT_SOURCE_DIR}/src
31+
)
3232

3333
# Configure compilation flags and libraries for the example... see the corresponding function
3434
# in hw/bsp/FAMILY/family.cmake for details.
35-
family_configure_device_example(${PROJECT})
35+
family_configure_device_example(${PROJECT} noos)
3636

3737
# Uncomment me to enable UART based debugging
3838
# pico_enable_stdio_uart(${PROJECT} 1)

examples/device/cdc_uac2/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
include ../../make.mk
2+
3+
INC += \
4+
src \
5+
$(TOP)/hw \
6+
7+
# Example source
8+
EXAMPLE_SOURCE += \
9+
src/cdc_app.c \
10+
src/main.c \
11+
src/uac2_app.c \
12+
src/usb_descriptors.c \
13+
14+
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
15+
16+
include ../../rules.mk

examples/device/cdc_uac2/skip.txt

Lines changed: 0 additions & 52 deletions
This file was deleted.

examples/device/cdc_uac2/src/usb_descriptors.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,30 @@ uint8_t const * tud_descriptor_device_cb(void)
9292
#define EPNUM_AUDIO_IN 0x08
9393
#define EPNUM_AUDIO_OUT 0x08
9494

95+
#define EPNUM_CDC_NOTIF 0x81
96+
#define EPNUM_CDC_OUT 0x02
97+
#define EPNUM_CDC_IN 0x82
98+
9599
#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
96100
// SAMG & SAME70 don't support a same endpoint number with different direction IN and OUT
97101
// e.g EP1 OUT & EP1 IN cannot exist together
98102
#define EPNUM_AUDIO_IN 0x01
99103
#define EPNUM_AUDIO_OUT 0x02
100104

105+
#define EPNUM_CDC_NOTIF 0x83
106+
#define EPNUM_CDC_OUT 0x04
107+
#define EPNUM_CDC_IN 0x85
108+
101109
#elif CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X
102110
// FT9XX doesn't support a same endpoint number with different direction IN and OUT
103111
// e.g EP1 OUT & EP1 IN cannot exist together
104112
#define EPNUM_AUDIO_IN 0x01
105113
#define EPNUM_AUDIO_OUT 0x02
106114

115+
#define EPNUM_CDC_NOTIF 0x83
116+
#define EPNUM_CDC_OUT 0x04
117+
#define EPNUM_CDC_IN 0x85
118+
107119
#else
108120
#define EPNUM_AUDIO_IN 0x01
109121
#define EPNUM_AUDIO_OUT 0x01

0 commit comments

Comments
 (0)