Skip to content
Snippets Groups Projects
Commit 5b2c4753 authored by Arturo Guadalupi's avatar Arturo Guadalupi Committed by GitHub
Browse files

Merge pull request #148 from sandeepmistry/SerialUSB.availableForWrite

Add Serial_::availableForWrite()
parents 683845e4 97e9c26f
No related branches found
No related tags found
No related merge requests found
......@@ -202,6 +202,13 @@ int Serial_::available(void)
return (uint32_t)(CDC_SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % CDC_SERIAL_BUFFER_SIZE;
}
int Serial_::availableForWrite(void)
{
// return the number of bytes left in the current bank,
// always EP size - 1, because bank is flushed on every write
return (EPX_SIZE - 1);
}
int Serial_::peek(void)
{
ring_buffer *buffer = &cdc_rx_buffer;
......
......@@ -118,6 +118,7 @@ public:
void end(void);
virtual int available(void);
virtual int availableForWrite(void);
virtual void accept(void);
virtual int peek(void);
virtual int read(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment