Skip to content

Commit 70fd45a

Browse files
committed
enable uvc for samd and nrf
1 parent 536c823 commit 70fd45a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/arduino/ports/nrf/tusb_config_nrf.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,18 @@ extern "C" {
3333
// COMMON CONFIGURATION
3434
//--------------------------------------------------------------------
3535
#define CFG_TUSB_MCU OPT_MCU_NRF5X
36-
3736
#define CFG_TUSB_OS OPT_OS_FREERTOS
38-
#define CFG_TUSB_MEM_SECTION
39-
#define CFG_TUSB_MEM_ALIGN __attribute__((aligned(4)))
4037

4138
#ifndef CFG_TUSB_DEBUG
4239
#define CFG_TUSB_DEBUG 0
4340
#endif
4441

4542
// For selectively disable device log (when > CFG_TUSB_DEBUG)
4643
// #define CFG_TUD_LOG_LEVEL 3
44+
// #define CFG_TUH_LOG_LEVEL 3
45+
46+
#define CFG_TUSB_MEM_SECTION
47+
#define CFG_TUSB_MEM_ALIGN __attribute__((aligned(4)))
4748

4849
#ifdef USE_TINYUSB
4950
// Enable device stack
@@ -70,6 +71,11 @@ extern "C" {
7071
#define CFG_TUD_HID 2
7172
#define CFG_TUD_MIDI 1
7273
#define CFG_TUD_VENDOR 1
74+
#define CFG_TUD_VIDEO 1 // number of video control interfaces
75+
#define CFG_TUD_VIDEO_STREAMING 1 // number of video streaming interfaces
76+
77+
// video streaming endpoint buffer size
78+
#define CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE 256
7379

7480
// CDC FIFO size of TX and RX
7581
#define CFG_TUD_CDC_RX_BUFSIZE 256

src/arduino/ports/samd/tusb_config_samd.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ extern "C" {
3838
#define CFG_TUSB_MCU OPT_MCU_SAMD21
3939
#endif
4040

41+
#ifndef CFG_TUSB_OS
4142
#define CFG_TUSB_OS OPT_OS_NONE
43+
#endif
4244

4345
#ifndef CFG_TUSB_DEBUG
4446
#define CFG_TUSB_DEBUG 0
4547
#endif
4648

4749
// For selectively disable device log (when > CFG_TUSB_DEBUG)
4850
// #define CFG_TUD_LOG_LEVEL 3
51+
// #define CFG_TUH_LOG_LEVEL 3
4952

5053
#define CFG_TUSB_MEM_SECTION
5154
#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
@@ -69,6 +72,11 @@ extern "C" {
6972
#define CFG_TUD_HID 2
7073
#define CFG_TUD_MIDI 1
7174
#define CFG_TUD_VENDOR 1
75+
#define CFG_TUD_VIDEO 1 // number of video control interfaces
76+
#define CFG_TUD_VIDEO_STREAMING 1 // number of video streaming interfaces
77+
78+
// video streaming endpoint buffer size
79+
#define CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE 256
7280

7381
// CDC FIFO size of TX and RX
7482
#define CFG_TUD_CDC_RX_BUFSIZE 256

0 commit comments

Comments
 (0)