Skip to content

Commit b6b9dc5

Browse files
committed
change(esp_tinyusb): Updated CHANGELOG.md and README.md
1 parent 1990835 commit b6b9dc5

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

device/esp_tinyusb/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [Unreleased]
2+
3+
- esp_tinyusb: Added possibility to select blocking time for dedicated TinyUSB task
4+
15
## 2.0.1~1
26

37
- esp_tinyusb: Claim forward compatibility with TinyUSB 0.19

device/esp_tinyusb/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,29 @@ When the default parameters of the internal task should be changed:
177177
}
178178
```
179179
180+
When your app calls `tinyusb_driver_uninstall()`, the driver is responsible for cleanly stopping the internal TinyUSB task. To make the start/stop points deterministic (so your code knows when the task is fully started or stopped), the driver exposes a blocking timeout for the TinyUSB task loop.
181+
182+
This timeout is the maximum time (ms) the TinyUSB task may block while waiting/servicing USB events before returning to your loop. It is not a polling interval.
183+
184+
> **Note:** The default blocking value for each CPU was selected by aligning the CPU Load during the legacy (blocking indefinetely) mode and non-blocking. To enable the blocking indefinetely (legacy mode) back, set the `blocking_timeout_ms` to `UINT32_MAX`
185+
186+
Example:
187+
188+
```c
189+
#include "tinyusb_default_config.h"
190+
191+
void main(void) {
192+
tinyusb_config_t tusb_cfg = TINYUSB_DEFAULT_CONFIG();
193+
tusb_cfg.task.blocking_timeout_ms = 3000;
194+
tinyusb_driver_install(&tusb_cfg);
195+
196+
// ...
197+
198+
tinyusb_driver_uninstall(); // will stop deterministically within ~blocking_timeout_ms
199+
}
200+
```
201+
> **💡 Tip:** If you need very low CPU usage and don’t care about stop latency, use a larger value (hundreds or thousands of ms). If you need quick teardown (e.g., switching roles or remounting), keep this small.
202+
180203
### USB Descriptors configuration
181204

182205
Configure USB descriptors using the `tinyusb_config_t` structure:

0 commit comments

Comments
 (0)