From 6914af0d632799158fa8de92701ba9707874e8ec Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 26 May 2014 13:40:29 +0200 Subject: [PATCH] USB CDC available() method returns correct number of bytes in buffer. See #1953 --- hardware/arduino/cores/arduino/CDC.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/cores/arduino/CDC.cpp b/hardware/arduino/cores/arduino/CDC.cpp index 3dbf15df3..3cfd1b756 100644 --- a/hardware/arduino/cores/arduino/CDC.cpp +++ b/hardware/arduino/cores/arduino/CDC.cpp @@ -129,7 +129,7 @@ void Serial_::end(void) int Serial_::available(void) { if (peek_buffer >= 0) { - return 1; + return 1 + USB_Available(CDC_RX); } return USB_Available(CDC_RX); }