summaryrefslogtreecommitdiffstats
path: root/app/cdcacm.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/cdcacm.c')
-rw-r--r--app/cdcacm.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/app/cdcacm.c b/app/cdcacm.c
index af45ac6..5327c0a 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;
}