From 75f2a8451e6ab622f8974b77b76b16ac2d057349 Mon Sep 17 00:00:00 2001 From: c1570 Date: Thu, 25 Sep 2025 01:01:01 +0200 Subject: improve flow --- docs/reference/configuration.rst | 14 ++++++++++---- docs/reference/usb_classes.rst | 5 +---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/configuration.rst b/docs/reference/configuration.rst index 79aeb15d8..fa0a874f5 100644 --- a/docs/reference/configuration.rst +++ b/docs/reference/configuration.rst @@ -173,15 +173,21 @@ Memory Management RTOS Configuration ------------------ -**FreeRTOS**: +TinyUSB supports multiple operating systems through its OSAL (Operating System Abstraction Layer). Choose the appropriate configuration based on your target environment. + +**FreeRTOS Integration**: + +When using FreeRTOS, configure the task queue sizes to handle USB events efficiently: .. code-block:: c #define CFG_TUSB_OS OPT_OS_FREERTOS - #define CFG_TUD_TASK_QUEUE_SZ 16 - #define CFG_TUH_TASK_QUEUE_SZ 16 + #define CFG_TUD_TASK_QUEUE_SZ 16 // Device task queue size + #define CFG_TUH_TASK_QUEUE_SZ 16 // Host task queue size + +**RT-Thread Integration**: -**RT-Thread**: +RT-Thread requires only the OS selection, as it uses the RTOS's built-in primitives: .. code-block:: c diff --git a/docs/reference/usb_classes.rst b/docs/reference/usb_classes.rst index 00a251ffb..387587b48 100644 --- a/docs/reference/usb_classes.rst +++ b/docs/reference/usb_classes.rst @@ -268,10 +268,7 @@ Most classes require callback functions: Performance Considerations -------------------------- -- **Buffer Sizes**: Match endpoint buffer sizes to expected data rates -- **Transfer Types**: Use appropriate USB transfer types (bulk, interrupt, isochronous) -- **CPU Usage**: Minimize processing in interrupt context -- **Memory Usage**: Static allocation only, no dynamic memory +When implementing USB classes, match **buffer sizes** to expected data rates to avoid bottlenecks. Choose appropriate **transfer types** based on your application's requirements. Keep **callback processing** lightweight for optimal performance. Avoid **memory allocations in critical paths** where possible to maintain consistent performance. Testing and Validation ---------------------- -- cgit v1.3.1