summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2025-11-26 11:10:34 +0100
committerZixun LI <[email protected]>2025-11-26 11:10:34 +0100
commit37df71cae4c37faaffa1f8a6fc236ec763e4ec03 (patch)
treea488ca65990df163e26e078b581fa428c964bbb9 /examples
parenta965e1fa4bd92104d68ab20beb1bb56a5019e153 (diff)
parent38842491bb55260c0cc7d7709abe5b0e73a0de61 (diff)
Merge remote-tracking branch 'tinyusb/master' into hcd_fsdev
Diffstat (limited to 'examples')
-rw-r--r--examples/build_system/cmake/cpu/cortex-m55.cmake2
-rw-r--r--examples/device/audio_test_multi_rate/src/usb_descriptors.c4
-rw-r--r--examples/device/cdc_dual_ports/src/usb_descriptors.c4
-rwxr-xr-xexamples/device/uac2_speaker_fb/src/audio_debug.py13
-rw-r--r--examples/device/uac2_speaker_fb/src/usb_descriptors.c4
-rw-r--r--examples/device/video_capture/src/usb_descriptors.c4
-rw-r--r--examples/device/video_capture_2ch/src/usb_descriptors.c4
7 files changed, 20 insertions, 15 deletions
diff --git a/examples/build_system/cmake/cpu/cortex-m55.cmake b/examples/build_system/cmake/cpu/cortex-m55.cmake
index a7a57957c..d5f6fa74a 100644
--- a/examples/build_system/cmake/cpu/cortex-m55.cmake
+++ b/examples/build_system/cmake/cpu/cortex-m55.cmake
@@ -13,6 +13,7 @@ elseif (TOOLCHAIN STREQUAL "clang")
--target=arm-none-eabi
-mcpu=cortex-m55
-mfpu=fpv5-d16
+ -mcmse
)
set(FREERTOS_PORT GCC_ARM_CM55_NTZ_NONSECURE CACHE INTERNAL "")
@@ -20,6 +21,7 @@ elseif (TOOLCHAIN STREQUAL "iar")
set(TOOLCHAIN_COMMON_FLAGS
--cpu cortex-m55
--fpu VFPv5_D16
+ --cmse
)
set(FREERTOS_PORT IAR_ARM_CM55_NTZ_NONSECURE CACHE INTERNAL "")
diff --git a/examples/device/audio_test_multi_rate/src/usb_descriptors.c b/examples/device/audio_test_multi_rate/src/usb_descriptors.c
index 471eb4f2e..505936fdb 100644
--- a/examples/device/audio_test_multi_rate/src/usb_descriptors.c
+++ b/examples/device/audio_test_multi_rate/src/usb_descriptors.c
@@ -119,8 +119,8 @@ TU_VERIFY_STATIC(sizeof(desc2_uac2_configuration) == CONFIG_UAC2_TOTAL_LEN, "Inc
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
tusb_desc_device_qualifier_t const desc_device_qualifier = {
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
+ .bLength = sizeof(tusb_desc_device_qualifier_t),
+ .bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
.bcdUSB = 0x0200,
.bDeviceClass = TUSB_CLASS_MISC,
diff --git a/examples/device/cdc_dual_ports/src/usb_descriptors.c b/examples/device/cdc_dual_ports/src/usb_descriptors.c
index dd0aefaea..e6011c35a 100644
--- a/examples/device/cdc_dual_ports/src/usb_descriptors.c
+++ b/examples/device/cdc_dual_ports/src/usb_descriptors.c
@@ -153,8 +153,8 @@ static uint8_t const desc_hs_configuration[] = {
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
static tusb_desc_device_qualifier_t const desc_device_qualifier = {
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
+ .bLength = sizeof(tusb_desc_device_qualifier_t),
+ .bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
.bcdUSB = USB_BCD,
.bDeviceClass = TUSB_CLASS_MISC,
diff --git a/examples/device/uac2_speaker_fb/src/audio_debug.py b/examples/device/uac2_speaker_fb/src/audio_debug.py
index 05b49baf6..1c6035a44 100755
--- a/examples/device/uac2_speaker_fb/src/audio_debug.py
+++ b/examples/device/uac2_speaker_fb/src/audio_debug.py
@@ -2,13 +2,15 @@
# Install python3 HID package https://pypi.org/project/hid/
# Install python3 matplotlib package https://pypi.org/project/matplotlib/
-from ctypes import *
+from ctypes import Structure, c_uint32, c_uint8, c_int8, c_int16, c_uint16
+import signal
try:
import hid
import matplotlib.pyplot as plt
import matplotlib.animation as animation
except:
print("Missing import, please try 'pip install hid matplotlib' or consult your OS's python package manager.")
+ exit(1)
# Example must be compiled with CFG_AUDIO_DEBUG=1
VID = 0xcafe
@@ -29,6 +31,7 @@ class audio_debug_info_t (Structure):
dev = hid.Device(VID, PID)
if dev:
+ signal.signal(signal.SIGINT, signal.SIG_DFL)
# Create figure for plotting
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -61,10 +64,10 @@ if dev:
ax.set_ylim(bottom=0, top=info.fifo_size)
# Format plot
- plt.title('FIFO information')
- plt.grid()
+ ax.set_title('FIFO information')
+ ax.grid(True)
print(f'Sample rate:{info.sample_rate} | Alt settings:{info.alt_settings} | Volume:{info.volume[:]}')
- ani = animation.FuncAnimation(fig, animate, interval=10)
- plt.show()
+ ani = animation.FuncAnimation(fig, animate, interval=10, cache_frame_data=False) # type: ignore
+ plt.show(block=True)
diff --git a/examples/device/uac2_speaker_fb/src/usb_descriptors.c b/examples/device/uac2_speaker_fb/src/usb_descriptors.c
index 697e51483..c5a161a1e 100644
--- a/examples/device/uac2_speaker_fb/src/usb_descriptors.c
+++ b/examples/device/uac2_speaker_fb/src/usb_descriptors.c
@@ -174,8 +174,8 @@ TU_VERIFY_STATIC(sizeof(desc_uac2_configuration) == CONFIG_UAC2_TOTAL_LEN, "Inco
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
tusb_desc_device_qualifier_t const desc_device_qualifier = {
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
+ .bLength = sizeof(tusb_desc_device_qualifier_t),
+ .bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
.bcdUSB = 0x0200,
.bDeviceClass = TUSB_CLASS_MISC,
diff --git a/examples/device/video_capture/src/usb_descriptors.c b/examples/device/video_capture/src/usb_descriptors.c
index 114dd5722..b3382c82d 100644
--- a/examples/device/video_capture/src/usb_descriptors.c
+++ b/examples/device/video_capture/src/usb_descriptors.c
@@ -385,8 +385,8 @@ static uint8_t * get_hs_configuration_desc(void) {
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
static tusb_desc_device_qualifier_t const desc_device_qualifier = {
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
+ .bLength = sizeof(tusb_desc_device_qualifier_t),
+ .bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
.bcdUSB = USB_BCD,
.bDeviceClass = TUSB_CLASS_MISC,
diff --git a/examples/device/video_capture_2ch/src/usb_descriptors.c b/examples/device/video_capture_2ch/src/usb_descriptors.c
index 024d16e07..8dc986da6 100644
--- a/examples/device/video_capture_2ch/src/usb_descriptors.c
+++ b/examples/device/video_capture_2ch/src/usb_descriptors.c
@@ -552,8 +552,8 @@ static uint8_t * get_hs_configuration_desc(void) {
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
static tusb_desc_device_qualifier_t const desc_device_qualifier = {
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
+ .bLength = sizeof(tusb_desc_device_qualifier_t),
+ .bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
.bcdUSB = USB_BCD,
.bDeviceClass = TUSB_CLASS_MISC,