aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/USBCore.cpp
diff options
context:
space:
mode:
authorPeter Van Hoyweghen <peter@Dell4550.(none)>2012-07-30 21:54:19 +0200
committerDavid A. Mellis <d.mellis@arduino.cc>2012-09-13 08:46:45 -0400
commitdc86d26a11ffe3e1ac9add8fb2d397fbee20984b (patch)
tree1a2d991c9a2293c6490baa8b55b608e0a1b0a648 /cores/arduino/USBCore.cpp
parent5ca747e312e70aa87b6056c15f6dae41c2f0f20c (diff)
Avoid serial buffer overrun on leonardo
Diffstat (limited to 'cores/arduino/USBCore.cpp')
-rw-r--r--cores/arduino/USBCore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp
index 6766be6..8bcf66c 100644
--- a/cores/arduino/USBCore.cpp
+++ b/cores/arduino/USBCore.cpp
@@ -603,7 +603,7 @@ ISR(USB_GEN_vect)
{
#ifdef CDC_ENABLED
USB_Flush(CDC_TX); // Send a tx frame if found
- while (USB_Available(CDC_RX)) // Handle received bytes (if any)
+ if (USB_Available(CDC_RX)) // Handle received bytes (if any)
Serial.accept();
#endif