summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authortobozo <[email protected]>2022-04-25 01:43:46 +0200
committerGitHub <[email protected]>2022-04-25 01:43:46 +0200
commit9e38b4cc68d9eeeb055349a97caf30d1cf4000e0 (patch)
tree68c63fe8b0625b84e2ca4398f9f79d80f5dc3495 /examples/device
parent9526a0ff736ccc4c8a9791a8467d6a6de82c0c45 (diff)
parent55a5fd59d7263289f5c26d52ab206ed571cc1e0c (diff)
Merge branch 'hathach:master' into master
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/cdc_msc_freertos/src/main.c14
-rw-r--r--examples/device/hid_composite_freertos/src/CMakeLists.txt2
-rw-r--r--examples/device/hid_composite_freertos/src/main.c4
-rw-r--r--examples/device/uac2_headset/src/usb_descriptors.h2
4 files changed, 14 insertions, 8 deletions
diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c
index 0a1c964ae..a5e907199 100644
--- a/examples/device/cdc_msc_freertos/src/main.c
+++ b/examples/device/cdc_msc_freertos/src/main.c
@@ -130,8 +130,11 @@ void usb_device_task(void* param)
// RTOS forever loop
while (1)
{
- // tinyusb device task
+ // put this thread to waiting state until there is new events
tud_task();
+
+ // following code only run if tud_task() process at least 1 event
+ tud_cdc_write_flush();
}
}
@@ -181,7 +184,7 @@ void cdc_task(void* params)
// if ( tud_cdc_connected() )
{
// There are data available
- if ( tud_cdc_available() )
+ while ( tud_cdc_available() )
{
uint8_t buf[64];
@@ -194,12 +197,13 @@ void cdc_task(void* params)
// for throughput test e.g
// $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
tud_cdc_write(buf, count);
- tud_cdc_write_flush();
}
+
+ tud_cdc_write_flush();
}
- // For ESP32-S2 this delay is essential to allow idle how to run and reset wdt
- vTaskDelay(pdMS_TO_TICKS(10));
+ // For ESP32-Sx this delay is essential to allow idle how to run and reset watchdog
+ vTaskDelay(1);
}
}
diff --git a/examples/device/hid_composite_freertos/src/CMakeLists.txt b/examples/device/hid_composite_freertos/src/CMakeLists.txt
index 5d9fc74d3..25da8fcd7 100644
--- a/examples/device/hid_composite_freertos/src/CMakeLists.txt
+++ b/examples/device/hid_composite_freertos/src/CMakeLists.txt
@@ -31,5 +31,5 @@ target_sources(${COMPONENT_TARGET} PUBLIC
"${TOP}/src/class/net/ncm_device.c"
"${TOP}/src/class/usbtmc/usbtmc_device.c"
"${TOP}/src/class/vendor/vendor_device.c"
- "${TOP}/src/portable/espressif/esp32sx/dcd_esp32sx.c"
+ "${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c"
)
diff --git a/examples/device/hid_composite_freertos/src/main.c b/examples/device/hid_composite_freertos/src/main.c
index 1695f968c..317b64611 100644
--- a/examples/device/hid_composite_freertos/src/main.c
+++ b/examples/device/hid_composite_freertos/src/main.c
@@ -132,8 +132,10 @@ void usb_device_task(void* param)
// RTOS forever loop
while (1)
{
- // tinyusb device task
+ // put this thread to waiting state until there is new events
tud_task();
+
+ // following code only run if tud_task() process at least 1 event
}
}
diff --git a/examples/device/uac2_headset/src/usb_descriptors.h b/examples/device/uac2_headset/src/usb_descriptors.h
index d9510ea4f..342b4fac1 100644
--- a/examples/device/uac2_headset/src/usb_descriptors.h
+++ b/examples/device/uac2_headset/src/usb_descriptors.h
@@ -86,7 +86,7 @@ enum
#define TUD_AUDIO_HEADSET_STEREO_DESCRIPTOR(_stridx, _epout, _epin) \
/* Standard Interface Association Descriptor (IAD) */\
- TUD_AUDIO_DESC_IAD(/*_firstitfs*/ ITF_NUM_AUDIO_CONTROL, /*_nitfs*/ ITF_NUM_TOTAL, /*_stridx*/ 0x00),\
+ TUD_AUDIO_DESC_IAD(/*_firstitfs*/ ITF_NUM_AUDIO_CONTROL, /*_nitfs*/ 3, /*_stridx*/ 0x00),\
/* Standard AC Interface Descriptor(4.7.1) */\
TUD_AUDIO_DESC_STD_AC(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_nEPs*/ 0x00, /*_stridx*/ _stridx),\
/* Class-Specific AC Interface Header Descriptor(4.7.2) */\