aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/usb/usb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/usb/usb.c b/core/usb/usb.c
index cb8de52..a8298c0 100644
--- a/core/usb/usb.c
+++ b/core/usb/usb.c
@@ -407,6 +407,12 @@ uint8 usbReceiveBytes(uint8* recvBuf, uint8 len) {
}
maxNewBytes += len;
+
+ /* re-enable the rx endpoint which we had set to receive 0 bytes */
+ if (maxNewBytes - len == 0) {
+ SetEPRxCount(VCOM_RX_ENDP,maxNewBytes);
+ }
+
return len;
}
@@ -415,10 +421,12 @@ void usbSendHello(void) {
uint8 bufin = 48 + recvBufIn;;
uint8 bufout = 48 + recvBufOut;
+ uint8 avail = 48 + usbBytesAvailable();
char *line = "\r\n";
while(usbSendBytes(&bufin,1) == 0);
while(usbSendBytes(&bufout,1) == 0);
+ while(usbSendBytes(&avail,1) == 0);
while(usbSendBytes((uint8*)line,2) == 0);
uint8 recv[64];