From 75f2a8451e6ab622f8974b77b76b16ac2d057349 Mon Sep 17 00:00:00 2001 From: c1570 Date: Thu, 25 Sep 2025 01:01:01 +0200 Subject: improve flow --- docs/tutorials/first_device.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'docs/tutorials') diff --git a/docs/tutorials/first_device.rst b/docs/tutorials/first_device.rst index 9fac2df49..1b9ed5b0a 100644 --- a/docs/tutorials/first_device.rst +++ b/docs/tutorials/first_device.rst @@ -40,7 +40,7 @@ Key files in the example: * ``usb_descriptors.c`` - USB device descriptors * ``tusb_config.h`` - TinyUSB stack configuration -**Main Loop Pattern**: +The main loop follows a simple pattern that combines board initialization, TinyUSB initialization, and continuous task processing: .. code-block:: c @@ -54,11 +54,13 @@ Key files in the example: } } -**Device Task**: ``tud_task()`` must be called regularly to handle USB events and maintain the connection. +The ``tud_task()`` function must be called regularly to handle USB events and maintain the connection with the host. This function processes all queued USB events and triggers appropriate callbacks in your application code. Step 3: Build and Test ====================== +With a clear understanding of the code structure, you're ready to build and test the example. This process involves fetching dependencies, compiling for your target board, and flashing the firmware: + .. code-block:: bash # Fetch dependencies for your board family @@ -78,6 +80,8 @@ Step 3: Build and Test Step 4: Customize for Your Needs ================================= +Once you have the basic example working, you can customize it for your specific application. The following modifications demonstrate common customization patterns. + **Simplify to CDC-only**: 1. In ``tusb_config.h``, disable MSC: -- cgit v1.3.1