Skip to content

Commit 37e638b

Browse files
authored
Merge pull request #2657 from Rbb666/rtthread
[osal]Add usb-device and host macro controls.
2 parents 41c7cda + 2c88001 commit 37e638b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/rt-thread/SConscript

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ if GetDepend(["PKG_TINYUSB_DEVICE_ENABLE"]):
3434
src += ["../../src/class/cdc/cdc_device.c"]
3535
if GetDepend(["PKG_TINYUSB_DEVICE_MSC"]):
3636
src += ["../../src/class/msc/msc_device.c", "port/msc_device_port.c"]
37+
if GetDepend(["PKG_TINYUSB_DEVICE_HID"]):
38+
src += ["../../src/class/hid/hid_device.c"]
3739

3840
# for host stack
3941
if GetDepend(["PKG_TINYUSB_HOST_ENABLE"]):

lib/rt-thread/tusb_config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ extern "C" {
152152
#define CFG_TUH_ENABLED (0)
153153
#endif
154154

155-
#if (PKG_TINYUSB_HOST_PORT == 0)
155+
#if (PKG_TINYUSB_HOST_PORT == 0) && defined(PKG_TINYUSB_HOST_ENABLE)
156156
#undef CFG_TUSB_RHPORT0_MODE
157157
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_HOST | PKG_TINYUSB_HOST_PORT_SPEED)
158158
#endif
159159

160-
#if (PKG_TINYUSB_HOST_PORT == 1)
160+
#if (PKG_TINYUSB_HOST_PORT == 1) && defined(PKG_TINYUSB_HOST_ENABLE)
161161
#undef CFG_TUSB_RHPORT1_MODE
162162
#define CFG_TUSB_RHPORT1_MODE (OPT_MODE_HOST | PKG_TINYUSB_HOST_PORT_SPEED)
163163
#endif

0 commit comments

Comments
 (0)