Commit e7ad9be
stm32: Fix init sequence of USB hardware and TinyUSB stack.
This commit fixes the initialization sequence for TinyUSB when enabled on
the stm32 port:
- Following other ports, `mp_usbd_init()` should be called just after
running `boot.py`, to give the user a chance to configure USB.
- Hardware initialization (via `pyb_usbd_init()`) should only occur once,
the first time TinyUSB is started up. This is achieved by adding a hook
to the shared TinyUSB bindings to call `pyb_usbd_init()`, and only do the
hardware init if TinyUSB was not already initialized.
Also, `pyb_usbd_init()` is renamed `mp_usbd_ll_init()` to make it match
with the rest of the stared TinyUSB binding code.
Signed-off-by: Damien George <damien@micropython.org>1 parent 01fdd2e commit e7ad9be
File tree
5 files changed
+15
-8
lines changed- ports/stm32
5 files changed
+15
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
| 610 | + | |
615 | 611 | | |
616 | 612 | | |
617 | | - | |
618 | 613 | | |
619 | 614 | | |
620 | 615 | | |
| |||
686 | 681 | | |
687 | 682 | | |
688 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
689 | 688 | | |
690 | 689 | | |
691 | 690 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
308 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
309 | 315 | | |
310 | 316 | | |
311 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments