From 889623a83b0cf3ed7d132645dde2665bb61910b0 Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 17 Jan 2015 11:01:34 +0100 Subject: [PATCH] Improved USB-Serial Now the buffer can even shrink down to 2 bytes. Not sure why 1 bytes gives problems. Also a buffer with USB_EP_SIZE is now also possible. --- Readme.md | 1 + examples/Projects/USB-Serial/USB-Serial.ino | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 95a7019..ca00482 100644 --- a/Readme.md +++ b/Readme.md @@ -314,6 +314,7 @@ Version History * USB-Serial now fully reprogrammable * Easy USB-Core selection via Tools->USB-Core * Added Arduino as ISP fix for 32u4 (u2 Series doesn't work at the moment) +* Updated USB-Serial 2.0 Release (29.11.2014) * Added HoodLoader2 diff --git a/examples/Projects/USB-Serial/USB-Serial.ino b/examples/Projects/USB-Serial/USB-Serial.ino index 5d8ac8c..1c9e7eb 100644 --- a/examples/Projects/USB-Serial/USB-Serial.ino +++ b/examples/Projects/USB-Serial/USB-Serial.ino @@ -33,11 +33,10 @@ void loop() { // Serial -> USB if (Serial1.available()) { - Serial.flush(); // send maximum one EP_SIZE to give the usb some time to flush the buffer uint8_t buff[USB_EP_SIZE - 1]; int i = 0; - for (i = 0; i < USB_EP_SIZE - 1; i++) { + for (i = 0; i < sizeof(buff); i++) { if (Serial1.available()) buff[i] = Serial1.read(); else break;