summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/usbstack/usb_serial.c11
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 }