From 9da4b55529e3c9cb34be47ee23391c1dfd4dec5a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 10 Mar 2021 10:17:23 +0000 Subject: update libopencm3 to fix bugs in usb implementation --- app/cdcacm.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'app/cdcacm.c') diff --git a/app/cdcacm.c b/app/cdcacm.c index f6a1b0f..0b4a4e3 100644 --- a/app/cdcacm.c +++ b/app/cdcacm.c @@ -122,35 +122,36 @@ const struct usb_iface_assoc_descriptor cdc_iface_assoc = { -int cdcacm_control_request (usbd_device *usbd_dev, - struct usb_setup_data *req, - uint8_t **buf, - uint16_t *len, - usbd_control_complete_callback *complete) -{ +enum usbd_request_return_codes +cdcacm_control_request (usbd_device *usbd_dev, + struct usb_setup_data *req, + uint8_t **buf, + uint16_t *len, + usbd_control_complete_callback *complete) { (void) complete; (void) buf; (void) usbd_dev; - switch (req->bRequest) { + switch (req->bRequest) + { case USB_CDC_REQ_SET_CONTROL_LINE_STATE: { /* * This Linux cdc_acm driver requires this to be implemented * even though it's optional in the CDC spec, and we don't * advertise it in the ACM functional descriptor. */ - return 1; + return USBD_REQ_HANDLED; } case USB_CDC_REQ_SET_LINE_CODING: if (*len < sizeof (struct usb_cdc_line_coding)) - return 0; + return USBD_REQ_NOTSUPP; - return 1; + return USBD_REQ_HANDLED; } - return 0; + return USBD_REQ_NEXT_CALLBACK; } -- cgit v1.2.3