We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3254c67 commit 4f1b0d7Copy full SHA for 4f1b0d7
cores/arduino/USB/CDC.cpp
@@ -214,6 +214,13 @@ int Serial_::available(void)
214
return (unsigned int)(CDC_SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % CDC_SERIAL_BUFFER_SIZE;
215
}
216
217
+int Serial_::availableForWrite(void)
218
+{
219
+ // return the number of bytes left in the current bank,
220
+ // always EP size - 1, because bank is flushed on every write
221
+ return (EPX_SIZE - 1);
222
+}
223
+
224
int Serial_::peek(void)
225
{
226
ring_buffer *buffer = &cdc_rx_buffer;
cores/arduino/USB/USBAPI.h
@@ -54,6 +54,7 @@ class Serial_ : public Stream
54
void end(void);
55
56
virtual int available(void);
57
+ virtual int availableForWrite(void);
58
virtual void accept(void);
59
virtual int peek(void);
60
virtual int read(void);
0 commit comments