Serial.addMemoryForWrite

PDOS

Well-known member
I know I am late to the party but I have only recently discovered the very useful methods
such as
Serial1.addMemoryForRead(s1RxBuffer, sizeof(s1RxBuffer));
Serial1.addMemoryForWrite(s1TxBuffer, sizeof(s1TxBuffer));
which work nicely for me.

But when I try this
Serial.addMemoryForWrite(s1TxBuffer, sizeof(sTxBuffer));
I get the this
error: 'class usb_serial_class' has no member named 'addMemoryForWrite'

So Serial does not have methods such as 'addMemoryForWrite'.
Why is this?
Is there no need to adjust the receive and transmit buffer sizes for Serial?
Why?

Peter.
 
"Serial" uses USB, which is orders of magnitude faster and additionally uses USB buffers that are larger than those for HW serial.
The code is completely different.
 
Sure, for receive.
For transmit, larger buffers allow to fill them without beeing forced to wait.

Thanks for the answers. Yes, my concern, as Frank noted, was to transmit big blocks of data over Serial without adding undue delays within the main loop. But my blocks are in any case going out suspiciously fast, so it appears there are already quite big buffers in place.
 
Back
Top