summaryrefslogtreecommitdiff
path: root/openpicc/os
diff options
context:
space:
mode:
Diffstat (limited to 'openpicc/os')
-rw-r--r--openpicc/os/usb/USB-CDC.c8
-rw-r--r--openpicc/os/usb/USB-CDC.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/openpicc/os/usb/USB-CDC.c b/openpicc/os/usb/USB-CDC.c
index 13435b4..1b840c9 100644
--- a/openpicc/os/usb/USB-CDC.c
+++ b/openpicc/os/usb/USB-CDC.c
@@ -262,11 +262,17 @@ vUSBCDCTask (void *pvParameters)
void
vUSBSendByte (portCHAR cByte)
{
+ vUSBSendByte_blocking(cByte, usbNO_BLOCK);
+}
+
+void
+vUSBSendByte_blocking (portCHAR cByte, portTickType xTicksToWait)
+{
char chunk[CHUNK_SIZE];
chunk[0] = 1;
chunk[1] = cByte;
/* Queue the byte to be sent. The USB task will send it. */
- xQueueSend (xTxCDC, &chunk, usbNO_BLOCK);
+ xQueueSend (xTxCDC, &chunk, xTicksToWait);
}
#define MIN(a,b) ((a)>(b)?(b):(a))
diff --git a/openpicc/os/usb/USB-CDC.h b/openpicc/os/usb/USB-CDC.h
index 511c8a8..6074956 100644
--- a/openpicc/os/usb/USB-CDC.h
+++ b/openpicc/os/usb/USB-CDC.h
@@ -82,6 +82,7 @@ void vUSBCDCTask (void *pvParameters);
/* Send cByte down the USB port. Characters are simply buffered and not
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);
portLONG vUSBRecvByte (portCHAR *cByte,portLONG size, portTickType xTicksToWait);
personal git repositories of Harald Welte. Your mileage may vary