From 8d6602547bc7beb39652a35a1cfdddc250f683ff Mon Sep 17 00:00:00 2001 From: AJM Date: Sun, 25 Apr 2010 15:19:41 -0400 Subject: theres still a remaining bug whereby fast consecutive read/writes to serial might crash the fifo, but other than that it seems to work. see usbSendHello for an example. include usb.h in your application, and call setupUSB() to turn everything on. --- core/usb/usb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/usb/usb.c b/core/usb/usb.c index c0229ff..f20f144 100644 --- a/core/usb/usb.c +++ b/core/usb/usb.c @@ -396,19 +396,17 @@ uint8 usbBytesAvailable(void) { will only copy the minimum of len or the available bytes. returns the number of bytes copied */ uint8 usbReceiveBytes(uint8* recvBuf, uint8 len) { - uint8 bytesCopied; - if (len > VCOM_RX_EPSIZE - maxNewBytes) { len = VCOM_RX_EPSIZE - maxNewBytes; } int i; for (i=0;i