summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack/usb_serial.c
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-03-02 22:12:51 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-03-02 22:12:51 +0000
commit8abe9cffe4b495f64a0a440c9d99125115b9a002 (patch)
tree61c18d4139b39b8a89610230cb5f650f4bb4d8dd /firmware/usbstack/usb_serial.c
parent2aa48042e5cab4ef5495b7edc477a3eed066a9e7 (diff)
downloadrockbox-8abe9cffe4b495f64a0a440c9d99125115b9a002.tar.gz
rockbox-8abe9cffe4b495f64a0a440c9d99125115b9a002.tar.bz2
rockbox-8abe9cffe4b495f64a0a440c9d99125115b9a002.zip
remove a reundant MIN(), and reduce the buffer. We really don't need 16k for this. It seems to work reliably at full speed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16491 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/usb_serial.c')
-rw-r--r--firmware/usbstack/usb_serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c
index 5aca36b59a..c57c74e8ab 100644
--- a/firmware/usbstack/usb_serial.c
+++ b/firmware/usbstack/usb_serial.c
@@ -27,7 +27,7 @@
#ifdef USB_SERIAL
-#define BUFFER_SIZE 16384 /* No larger, because of controller limitations */
+#define BUFFER_SIZE 512 /* Max 16k because of controller limitations */
static unsigned char _send_buffer[BUFFER_SIZE] __attribute__((aligned(32)));
static unsigned char* send_buffer;
@@ -83,7 +83,7 @@ void usb_serial_send(unsigned char *data,int length)
/* current buffer wraps, so new data can't */
int available_space = BUFFER_SIZE - buffer_length;
length=MIN(length,available_space);
- memcpy(&send_buffer[(buffer_start+buffer_length)%BUFFER_SIZE],data,MIN(length,available_space));
+ memcpy(&send_buffer[(buffer_start+buffer_length)%BUFFER_SIZE],data,length);
buffer_length+=length;
}
else