diff options
| author | Jeremy Herbert <[email protected]> | 2019-12-30 13:58:06 +1000 |
|---|---|---|
| committer | Ha Thach <[email protected]> | 2019-12-30 10:58:06 +0700 |
| commit | db24b2f3728cc29af5b2688f9cd7ab0b4b3f22b5 (patch) | |
| tree | 5b4eee4e8e61e92320413bf5a0f9f62f4f27ebfb /src/common | |
| parent | 8e04eafb8a71ac214cfcb8b5a19c2b9aa00c492b (diff) | |
Let device respond to endpoint requests on EP0 (#251)
Since endpoint 0 is used for control requests, it doesn't have a class driver attached to it. As such, the corresponding `_usbd_dev.ep2drv` entry points to driver `0xFF`, which is invalid and this makes the `TU_ASSERT(drvid < USBD_CLASS_DRIVER_COUNT);` line fail, and eventually causes an endpoint stall. So as-is the stack cannot respond to any endpoint requests on endpoint 0.
However, standard requests on endpoint 0 do not need a class driver to produce a valid response. This commit changes the order of execution so that the assert is only checked if the endpoint is not 0.
Diffstat (limited to 'src/common')
0 files changed, 0 insertions, 0 deletions
