From 672bbe434b12d4730cf270f7245753fb98cf162d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 19 Sep 2021 10:54:26 +0100 Subject: 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 --- firmware/usbstack/usb_serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/usbstack/usb_serial.c') 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 if (req->wLength == sizeof(line_coding)) { /* Receive line coding into local copy */ - usb_drv_recv(EP_CONTROL, &line_coding, sizeof(line_coding)); + usb_drv_recv_nonblocking(EP_CONTROL, &line_coding, sizeof(line_coding)); usb_drv_send(EP_CONTROL, NULL, 0); /* ack */ handled = true; } @@ -316,7 +316,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, unsigned char* dest if (req->wLength == sizeof(line_coding)) { /* Send back line coding so host is happy */ - usb_drv_recv(EP_CONTROL, NULL, 0); /* ack */ + usb_drv_recv_nonblocking(EP_CONTROL, NULL, 0); /* ack */ usb_drv_send(EP_CONTROL, &line_coding, sizeof(line_coding)); handled = true; } @@ -329,7 +329,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, unsigned char* dest void usb_serial_init_connection(void) { /* prime rx endpoint */ - usb_drv_recv(ep_out, receive_buffer, sizeof receive_buffer); + usb_drv_recv_nonblocking(ep_out, receive_buffer, sizeof receive_buffer); /* we come here too after a bus reset, so reset some data */ buffer_transitlength = 0; @@ -420,7 +420,7 @@ void usb_serial_transfer_complete(int ep,int dir, int status, int length) /* Data received. TODO : Do something with it ? */ /* Get the next bit */ - usb_drv_recv(ep_out, receive_buffer, sizeof receive_buffer); + usb_drv_recv_nonblocking(ep_out, receive_buffer, sizeof receive_buffer); break; case USB_DIR_IN: -- cgit v1.2.3