From 3baff3b4114f28cd6ae0bfbb25d4efeb6f03278b Mon Sep 17 00:00:00 2001 From: Peter Van Hoyweghen Date: Sat, 4 Jul 2015 08:28:52 +0200 Subject: Add Serial_::availableForWrite(). This makes the CDC "Serial" object on the Leonardo and similar boards support this recently introduced method as well. The CDC code in the sam core is not changed. --- cores/arduino/CDC.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cores/arduino/CDC.cpp') diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index 5e872c5..afbc65d 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -163,6 +163,11 @@ int Serial_::read(void) return USB_Recv(CDC_RX); } +int Serial_::availableForWrite(void) +{ + return USB_SendSpace(CDC_TX); +} + void Serial_::flush(void) { USB_Flush(CDC_TX); -- cgit v1.2.3-18-g5258