diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-09-19 10:54:26 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-09-20 22:41:29 +0100 |
commit | 672bbe434b12d4730cf270f7245753fb98cf162d (patch) | |
tree | 3fdaa08ddc41f942336c968bb169e8806c7c3fa8 /firmware/usbstack/usb_serial.c | |
parent | 99f333c64f13c3f9a62b9f5e184ae87f053bf65a (diff) | |
download | rockbox-672bbe434b12d4730cf270f7245753fb98cf162d.tar.gz rockbox-672bbe434b12d4730cf270f7245753fb98cf162d.zip |
usb: rename usb_drv_recv() to usb_recv_recv_nonblocking()
IMHO the current name is somewhat misleading:
- usb_drv_send() is blocking and we have usb_drv_send_nonblocking()
for the non-blocking case. This inconsistent naming can only
promote confusion. (And what would we call a blocking receive?)
- Other hardware abstraction APIs in Rockbox are usually blocking:
storage, LCD, backlight, audio... in other words, blocking is the
default expected behavior, with non-blocking calls being a rarity.
Change-Id: I05b41088d09eab582697674f4f06fdca0c8950af
Diffstat (limited to 'firmware/usbstack/usb_serial.c')
-rw-r--r-- | firmware/usbstack/usb_serial.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c index a08394c0a8..c96936f1d4 100644 --- a/firmware/usbstack/usb_serial.c +++ b/firmware/usbstack/usb_serial.c | |||
@@ -294,7 +294,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, unsigned char* dest | |||
294 | if (req->wLength == sizeof(line_coding)) | 294 | if (req->wLength == sizeof(line_coding)) |
295 | { | 295 | { |
296 | /* Receive line coding into local copy */ | 296 | /* Receive line coding into local copy */ |
297 | usb_drv_recv(EP_CONTROL, &line_coding, sizeof(line_coding)); | 297 | usb_drv_recv_nonblocking(EP_CONTROL, &line_coding, sizeof(line_coding)); |
298 | usb_drv_send(EP_CONTROL, NULL, 0); /* ack */ | 298 | usb_drv_send(EP_CONTROL, NULL, 0); /* ack */ |
299 | handled = true; | 299 | handled = true; |
300 | } | 300 | } |
@@ -316,7 +316,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, unsigned char* dest | |||
316 | if (req->wLength == sizeof(line_coding)) | 316 | if (req->wLength == sizeof(line_coding)) |
317 | { | 317 | { |
318 | /* Send back line coding so host is happy */ | 318 | /* Send back line coding so host is happy */ |
319 | usb_drv_recv(EP_CONTROL, NULL, 0); /* ack */ | 319 | usb_drv_recv_nonblocking(EP_CONTROL, NULL, 0); /* ack */ |
320 | usb_drv_send(EP_CONTROL, &line_coding, sizeof(line_coding)); | 320 | usb_drv_send(EP_CONTROL, &line_coding, sizeof(line_coding)); |
321 | handled = true; | 321 | handled = true; |
322 | } | 322 | } |
@@ -329,7 +329,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, unsigned char* dest | |||
329 | void usb_serial_init_connection(void) | 329 | void usb_serial_init_connection(void) |
330 | { | 330 | { |
331 | /* prime rx endpoint */ | 331 | /* prime rx endpoint */ |
332 | usb_drv_recv(ep_out, receive_buffer, sizeof receive_buffer); | 332 | usb_drv_recv_nonblocking(ep_out, receive_buffer, sizeof receive_buffer); |
333 | 333 | ||
334 | /* we come here too after a bus reset, so reset some data */ | 334 | /* we come here too after a bus reset, so reset some data */ |
335 | buffer_transitlength = 0; | 335 | buffer_transitlength = 0; |
@@ -420,7 +420,7 @@ void usb_serial_transfer_complete(int ep,int dir, int status, int length) | |||
420 | /* Data received. TODO : Do something with it ? */ | 420 | /* Data received. TODO : Do something with it ? */ |
421 | 421 | ||
422 | /* Get the next bit */ | 422 | /* Get the next bit */ |
423 | usb_drv_recv(ep_out, receive_buffer, sizeof receive_buffer); | 423 | usb_drv_recv_nonblocking(ep_out, receive_buffer, sizeof receive_buffer); |
424 | break; | 424 | break; |
425 | 425 | ||
426 | case USB_DIR_IN: | 426 | case USB_DIR_IN: |