From 872c88bb5f643702edcc8d0ebfc1f6cd13bcf414 Mon Sep 17 00:00:00 2001 From: Justin Rajewski Date: Tue, 18 Mar 2014 14:15:41 -0700 Subject: improved USB write speeds --- cores/arduino/CDC.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cores/arduino/CDC.cpp') diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index e1e859d..fb0c0e0 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -199,6 +199,11 @@ void Serial_::flush(void) } size_t Serial_::write(uint8_t c) +{ + return write(&c, 1); +} + +size_t Serial_::write(const uint8_t *buffer, size_t size) { /* only try to send bytes if the high-level CDC connection itself is open (not just the pipe) - the OS should set lineState when the port @@ -210,7 +215,7 @@ size_t Serial_::write(uint8_t c) // open connection isn't broken cleanly (cable is yanked out, host dies // or locks up, or host virtual serial port hangs) if (_usbLineInfo.lineState > 0) { - int r = USB_Send(CDC_TX,&c,1); + int r = USB_Send(CDC_TX,buffer,size); if (r > 0) { return r; } else { -- cgit v1.2.3-18-g5258