Commit 5a4c52d
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 aa2dc44 commit 5a4c52d
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 | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
| 614 | + | |
619 | 615 | | |
620 | 616 | | |
621 | | - | |
622 | 617 | | |
623 | 618 | | |
624 | 619 | | |
| |||
690 | 685 | | |
691 | 686 | | |
692 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
693 | 692 | | |
694 | 693 | | |
695 | 694 | | |
| |||
| 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 | | |
| |||
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
337 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
338 | 344 | | |
339 | 345 | | |
340 | 346 | | |
| |||
| 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