mirror of
git://soft.sys114.com/klipper
synced 2026-02-13 17:00:34 +09:00
usb_cdc: Add usb_read_ep0_setup() interface function
Use new usb_read_ep0_setup() function when reading a setup packet - this allows the low-level usb hardware code to better handle errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -412,9 +412,8 @@ static void
|
||||
usb_state_ready(void)
|
||||
{
|
||||
struct usb_ctrlrequest req;
|
||||
int_fast8_t ret = usb_read_ep0(&req, sizeof(req));
|
||||
int_fast8_t ret = usb_read_ep0_setup(&req, sizeof(req));
|
||||
if (ret != sizeof(req))
|
||||
// XXX - should verify that packet was sent with a setup token
|
||||
return;
|
||||
switch (req.bRequest) {
|
||||
case USB_REQ_GET_DESCRIPTOR: usb_req_get_descriptor(&req); break;
|
||||
|
||||
Reference in New Issue
Block a user