From 3318ba4795b9e9033db2ba1281144e8ba55bb4cb Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 20 Sep 2021 02:01:46 +0100 Subject: usb: port usb_serial control requests handling to new API Change-Id: I1405c9279e0e8e490e2bb2d03ff192b36db2634b --- firmware/usbstack/usb_serial.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'firmware/usbstack/usb_serial.c') diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c index fad62787ec..b49a5ca013 100644 --- a/firmware/usbstack/usb_serial.c +++ b/firmware/usbstack/usb_serial.c @@ -296,8 +296,10 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi if (req->wLength == sizeof(line_coding)) { /* Receive line coding into local copy */ - usb_drv_recv_nonblocking(EP_CONTROL, &line_coding, sizeof(line_coding)); - usb_drv_send(EP_CONTROL, NULL, 0); /* ack */ + if(!reqdata) + usb_drv_control_response(USB_CONTROL_RECEIVE, &line_coding, sizeof(line_coding)); + else + usb_drv_control_response(USB_CONTROL_ACK, NULL, 0); handled = true; } } @@ -306,7 +308,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi if (req->wLength == 0) { /* wValue holds Control Signal Bitmap that is simply ignored here */ - usb_drv_send(EP_CONTROL, NULL, 0); /* ack */ + usb_drv_control_response(USB_CONTROL_ACK, NULL, 0); handled = true; } } @@ -318,8 +320,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi if (req->wLength == sizeof(line_coding)) { /* Send back line coding so host is happy */ - usb_drv_recv_nonblocking(EP_CONTROL, NULL, 0); /* ack */ - usb_drv_send(EP_CONTROL, &line_coding, sizeof(line_coding)); + usb_drv_control_response(USB_CONTROL_ACK, &line_coding, sizeof(line_coding)); handled = true; } } -- cgit v1.2.3