Commit f1ad79b
committed
more usb.core.Device vid/pid error handling
This fixes a bug where common_hal_usb_core_device_get_idVendor()
and common_hal_usb_core_device_get_idProduct() were ignoring the
error check boolean returned by tuh_vid_pid_get().
Also, this includes a workaround for what appears to be a TinyUSB
glitch with enumeration and assigning addresses. By adding a 50 ms
background task loop before raising the exception after a TinyUSB
failure result, somehow the vid/pid error condition magically goes
away on it's own. Something subtle and weird is happening here
which could use further investigation.1 parent 42b53b7 commit f1ad79b
File tree
2 files changed
+27
-3
lines changed2 files changed
+27
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
74 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
75 | 88 | | |
76 | 89 | | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
81 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
82 | 97 | | |
83 | 98 | | |
84 | 99 | | |
| |||
135 | 150 | | |
136 | 151 | | |
137 | 152 | | |
138 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
139 | 162 | | |
140 | 163 | | |
141 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
0 commit comments