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.
This commit is contained in:
Nico 2015-01-17 11:01:34 +01:00
parent 691befadf4
commit 889623a83b
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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;