aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/CDC.cpp
diff options
context:
space:
mode:
authorPeter Van Hoyweghen <N.A>2015-07-04 08:28:52 +0200
committerMatthijs Kooijman <matthijs@stdin.nl>2015-07-31 14:06:20 +0200
commit3baff3b4114f28cd6ae0bfbb25d4efeb6f03278b (patch)
tree391c8bd961cfa269566e33422df15cce616d7259 /cores/arduino/CDC.cpp
parent303ebdb0ccbc13dec765f1ce7ca681d73a7e9b90 (diff)
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.
Diffstat (limited to 'cores/arduino/CDC.cpp')
-rw-r--r--cores/arduino/CDC.cpp5
1 files changed, 5 insertions, 0 deletions
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);