summaryrefslogtreecommitdiff
path: root/openpicc/os/usb
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-05 01:59:58 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-05 01:59:58 +0000
commit3ee3c4a649545d1f132bca61cc7484f0d5c92638 (patch)
tree9dfc8a38819b7b4965ca4ba74e333eb72f365b53 /openpicc/os/usb
parentbac6c469cc2116b6a2917f75c979722e616ef904 (diff)
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
Diffstat (limited to 'openpicc/os/usb')
-rw-r--r--openpicc/os/usb/USB-CDC.c13
-rw-r--r--openpicc/os/usb/USB-CDC.h1
2 files changed, 11 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
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
personal git repositories of Harald Welte. Your mileage may vary