aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/USBAPI.h
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-12-18 17:52:35 -0500
committerZach Eveland <zeveland@blacklabel-development.com>2011-12-18 17:52:35 -0500
commit58fc0d17cc2d7c5dfb4ce268b7e43d35eebac342 (patch)
tree062e7f2a87d4ae1878d75ed093c9f6a7f846ebc4 /cores/arduino/USBAPI.h
parent177641003c53844ad73584553a9d44f2da4648e2 (diff)
added asynchronous buffering of received CDC characters
This fixes the issue Federico reported where bytes written by host but not read by sketch would cause serial connection to lock up. Ring buffer implementation is based on HardwareSerial.cpp. Adds public accept() method to CDC.
Diffstat (limited to 'cores/arduino/USBAPI.h')
-rw-r--r--cores/arduino/USBAPI.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h
index 26a2032..1772c3c 100644
--- a/cores/arduino/USBAPI.h
+++ b/cores/arduino/USBAPI.h
@@ -27,11 +27,14 @@ extern USB_ USB;
class Serial_ : public Stream
{
+private:
+ ring_buffer *_cdc_rx_buffer;
public:
void begin(uint16_t baud_count);
void end(void);
virtual int available(void);
+ virtual void accept(void);
virtual int peek(void);
virtual int read(void);
virtual void flush(void);