Commit 82d6510
shared/tinyusb/mp_usbd_cdc: Rewrite USB CDC TX loop.
This is related to the previous commit (where due to the new config flag
this loop could end up stuck indefinitely if the USB host was
disconnected). The previous loop could maybe still get stuck if the
low-level USB state and the high-level USB state got out of sync. (Not
clearly possible, but hard to say definitely not possible.)
To be "belts and braces" careful:
- Always run mp_usbd_task() each time around the loop to progress the
state.
- Always evaluate the timeout if we fail to write anything to the FIFO.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <[email protected]>1 parent 869e01e commit 82d6510
File tree
1 file changed
+29
-16
lines changed1 file changed
+29
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 105 | + | |
107 | 106 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
118 | 112 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 113 | | |
123 | | - | |
| 114 | + | |
124 | 115 | | |
125 | 116 | | |
126 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
| |||
0 commit comments