summaryrefslogtreecommitdiff
path: root/openpicc/os/usb/USB-CDC.c
diff options
context:
space:
mode:
Diffstat (limited to 'openpicc/os/usb/USB-CDC.c')
-rw-r--r--openpicc/os/usb/USB-CDC.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/openpicc/os/usb/USB-CDC.c b/openpicc/os/usb/USB-CDC.c
index 1b840c9..c005597 100644
--- a/openpicc/os/usb/USB-CDC.c
+++ b/openpicc/os/usb/USB-CDC.c
@@ -123,7 +123,7 @@ transmitted. Rx queue must be larger than FIFO size. */
static xQueueHandle xRxCDC;
static xQueueHandle xTxCDC;
-#define CHUNK_SIZE 8
+#define CHUNK_SIZE 9
/* Line coding - 115,200 baud, N-8-1 */
static const unsigned portCHAR pxLineCoding[] =
@@ -277,7 +277,7 @@ vUSBSendByte_blocking (portCHAR cByte, portTickType xTicksToWait)
#define MIN(a,b) ((a)>(b)?(b):(a))
void
-vUSBSendBuffer (unsigned char *buffer, portBASE_TYPE offset, portBASE_TYPE length)
+vUSBSendBuffer_blocking (unsigned char *buffer, portBASE_TYPE offset, portBASE_TYPE length, portTickType xTicksToWait)
{
unsigned char chunk[CHUNK_SIZE];
while(length > 0) {
@@ -285,12 +285,19 @@ vUSBSendBuffer (unsigned char *buffer, portBASE_TYPE offset, portBASE_TYPE lengt
chunk[0] = next_size;
memcpy(chunk+1, buffer+offset, next_size);
/* Queue the bytes to be sent. The USB task will send it. */
- xQueueSend (xTxCDC, &chunk, usbNO_BLOCK);
+ xQueueSend (xTxCDC, &chunk, xTicksToWait);
length -= next_size;
offset += next_size;
}
}
+void
+vUSBSendBuffer (unsigned char *buffer, portBASE_TYPE offset, portBASE_TYPE length)
+{
+ vUSBSendBuffer_blocking(buffer, offset, length, usbNO_BLOCK);
+}
+
+
/*------------------------------------------------------------*/
portLONG
personal git repositories of Harald Welte. Your mileage may vary