We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 683845e + 97e9c26 commit 5b2c475Copy full SHA for 5b2c475
cores/arduino/USB/CDC.cpp
@@ -202,6 +202,13 @@ int Serial_::available(void)
202
return (uint32_t)(CDC_SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % CDC_SERIAL_BUFFER_SIZE;
203
}
204
205
+int Serial_::availableForWrite(void)
206
+{
207
+ // return the number of bytes left in the current bank,
208
+ // always EP size - 1, because bank is flushed on every write
209
+ return (EPX_SIZE - 1);
210
+}
211
+
212
int Serial_::peek(void)
213
{
214
ring_buffer *buffer = &cdc_rx_buffer;
cores/arduino/USB/USBAPI.h
@@ -118,6 +118,7 @@ class Serial_ : public Stream
118
void end(void);
119
120
virtual int available(void);
121
+ virtual int availableForWrite(void);
122
virtual void accept(void);
123
virtual int peek(void);
124
virtual int read(void);
0 commit comments