diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-09-20 02:01:46 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-10-16 21:14:42 +0100 |
commit | 3318ba4795b9e9033db2ba1281144e8ba55bb4cb (patch) | |
tree | 69ec27e778a9e25865d541f1bb9a369f349c37a0 /firmware | |
parent | 77731c3579e6311edf729de7899bfcbfd735ffa5 (diff) | |
download | rockbox-3318ba4795b9e9033db2ba1281144e8ba55bb4cb.tar.gz rockbox-3318ba4795b9e9033db2ba1281144e8ba55bb4cb.zip |
usb: port usb_serial control requests handling to new API
Change-Id: I1405c9279e0e8e490e2bb2d03ff192b36db2634b
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/usbstack/usb_serial.c | 11 |
1 files changed, 6 insertions, 5 deletions
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 | |||
296 | if (req->wLength == sizeof(line_coding)) | 296 | if (req->wLength == sizeof(line_coding)) |
297 | { | 297 | { |
298 | /* Receive line coding into local copy */ | 298 | /* Receive line coding into local copy */ |
299 | usb_drv_recv_nonblocking(EP_CONTROL, &line_coding, sizeof(line_coding)); | 299 | if(!reqdata) |
300 | usb_drv_send(EP_CONTROL, NULL, 0); /* ack */ | 300 | usb_drv_control_response(USB_CONTROL_RECEIVE, &line_coding, sizeof(line_coding)); |
301 | else | ||
302 | usb_drv_control_response(USB_CONTROL_ACK, NULL, 0); | ||
301 | handled = true; | 303 | handled = true; |
302 | } | 304 | } |
303 | } | 305 | } |
@@ -306,7 +308,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi | |||
306 | if (req->wLength == 0) | 308 | if (req->wLength == 0) |
307 | { | 309 | { |
308 | /* wValue holds Control Signal Bitmap that is simply ignored here */ | 310 | /* wValue holds Control Signal Bitmap that is simply ignored here */ |
309 | usb_drv_send(EP_CONTROL, NULL, 0); /* ack */ | 311 | usb_drv_control_response(USB_CONTROL_ACK, NULL, 0); |
310 | handled = true; | 312 | handled = true; |
311 | } | 313 | } |
312 | } | 314 | } |
@@ -318,8 +320,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi | |||
318 | if (req->wLength == sizeof(line_coding)) | 320 | if (req->wLength == sizeof(line_coding)) |
319 | { | 321 | { |
320 | /* Send back line coding so host is happy */ | 322 | /* Send back line coding so host is happy */ |
321 | usb_drv_recv_nonblocking(EP_CONTROL, NULL, 0); /* ack */ | 323 | usb_drv_control_response(USB_CONTROL_ACK, &line_coding, sizeof(line_coding)); |
322 | usb_drv_send(EP_CONTROL, &line_coding, sizeof(line_coding)); | ||
323 | handled = true; | 324 | handled = true; |
324 | } | 325 | } |
325 | } | 326 | } |