summaryrefslogtreecommitdiff
path: root/firmware/usbstack
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/usbstack')
-rw-r--r--firmware/usbstack/usb_serial.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c
index 4a80433..e3ef4f5 100644
--- a/firmware/usbstack/usb_serial.c
+++ b/firmware/usbstack/usb_serial.c
@@ -19,6 +19,7 @@
*
****************************************************************************/
#include "string.h"
+#include "config.h"
#include "system.h"
#include "usb_core.h"
#include "usb_drv.h"
@@ -60,6 +61,11 @@ static unsigned char send_buffer[BUFFER_SIZE]
USB_DEVBSS_ATTR __attribute__((aligned(32)));
static unsigned char receive_buffer[32]
USB_DEVBSS_ATTR __attribute__((aligned(32)));
+#if CONFIG_USBOTG == USBOTG_DESIGNWARE
+/* Aligned transit buffer */
+static unsigned char transit_buffer[32]
+ USB_DEVBSS_ATTR __attribute__((aligned(4)));
+#endif
static void sendout(void);
@@ -163,8 +169,13 @@ static void sendout(void)
if(buffer_transitlength > 0)
{
buffer_length -= buffer_transitlength;
+#if CONFIG_USBOTG == USBOTG_DESIGNWARE
+ memcpy(transit_buffer,&send_buffer[buffer_start],buffer_transitlength);
+ usb_drv_send_nonblocking(ep_in,transit_buffer,buffer_transitlength);
+#else
usb_drv_send_nonblocking(ep_in, &send_buffer[buffer_start],
buffer_transitlength);
+#endif
}
}