diff options
Diffstat (limited to 'firmware/usbstack')
-rw-r--r-- | firmware/usbstack/usb_serial.c | 4 |
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 @@ | |||
27 | 27 | ||
28 | #ifdef USB_SERIAL | 28 | #ifdef USB_SERIAL |
29 | 29 | ||
30 | #define BUFFER_SIZE 16384 /* No larger, because of controller limitations */ | 30 | #define BUFFER_SIZE 512 /* Max 16k because of controller limitations */ |
31 | static unsigned char _send_buffer[BUFFER_SIZE] __attribute__((aligned(32))); | 31 | static unsigned char _send_buffer[BUFFER_SIZE] __attribute__((aligned(32))); |
32 | static unsigned char* send_buffer; | 32 | static unsigned char* send_buffer; |
33 | 33 | ||
@@ -83,7 +83,7 @@ void usb_serial_send(unsigned char *data,int length) | |||
83 | /* current buffer wraps, so new data can't */ | 83 | /* current buffer wraps, so new data can't */ |
84 | int available_space = BUFFER_SIZE - buffer_length; | 84 | int available_space = BUFFER_SIZE - buffer_length; |
85 | length=MIN(length,available_space); | 85 | length=MIN(length,available_space); |
86 | memcpy(&send_buffer[(buffer_start+buffer_length)%BUFFER_SIZE],data,MIN(length,available_space)); | 86 | memcpy(&send_buffer[(buffer_start+buffer_length)%BUFFER_SIZE],data,length); |
87 | buffer_length+=length; | 87 | buffer_length+=length; |
88 | } | 88 | } |
89 | else | 89 | else |