From 3ee3c4a649545d1f132bca61cc7484f0d5c92638 Mon Sep 17 00:00:00 2001 From: henryk Date: Wed, 5 Mar 2008 01:59:58 +0000 Subject: Copy over the relevant changes from the sniffonly branch pending integration git-svn-id: https://svn.openpcd.org:2342/trunk@442 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/os/usb/USB-CDC.c | 13 ++++++++++--- openpicc/os/usb/USB-CDC.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'openpicc/os/usb') 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 diff --git a/openpicc/os/usb/USB-CDC.h b/openpicc/os/usb/USB-CDC.h index 6074956..6c0a779 100644 --- a/openpicc/os/usb/USB-CDC.h +++ b/openpicc/os/usb/USB-CDC.h @@ -84,6 +84,7 @@ sent unless the port is connected. */ void vUSBSendByte (portCHAR cByte); void vUSBSendByte_blocking (portCHAR cByte, portTickType xTicksToWait); void vUSBSendBuffer (unsigned char *buffer, portBASE_TYPE offset, portBASE_TYPE length); +void vUSBSendBuffer_blocking (unsigned char *buffer, portBASE_TYPE offset, portBASE_TYPE length, portTickType xTicksToWait); portLONG vUSBRecvByte (portCHAR *cByte,portLONG size, portTickType xTicksToWait); #endif -- cgit v1.2.3