Skip to content

Commit 01f9d68

Browse files
committed
change(esp_tinyusb): Updated CHANGELOG.md and README.md
1 parent 5e07902 commit 01f9d68

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,30 @@ When the default parameters of the internal task should be changed:
177177
}
178178
```
179179
180+
When your app calls `tinyusb_driver_uninstall()`, the driver cleanly stops 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 for or servicing USB events. It is not a polling interval.
183+
184+
> **Note:** Default timeout values may differ per CPU/target to match CPU load observed in legacy (block-forever) mode versus non-blocking mode.
185+
To re-enable legacy behavior (block indefinitely), set `blocking_timeout_ms` to `UINT32_MAX`.
186+
187+
You can configure the timeout during driver installation:
188+
189+
```c
190+
#include "tinyusb_default_config.h"
191+
192+
void main(void) {
193+
tinyusb_config_t tusb_cfg = TINYUSB_DEFAULT_CONFIG();
194+
tusb_cfg.task.blocking_timeout_ms = 3000;
195+
tinyusb_driver_install(&tusb_cfg);
196+
197+
// ...
198+
199+
tinyusb_driver_uninstall(); // will stop deterministically within ~blocking_timeout_ms
200+
}
201+
```
202+
> **💡 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.
203+
180204
### USB Descriptors configuration
181205

182206
Configure USB descriptors using the `tinyusb_config_t` structure:

0 commit comments

Comments
 (0)