Historically (years ago) I had an issue which required me to increase the serial buffers on a HW serial port on a T3.5 at the time - and I found some references to changes needed in the HardwareSerial1.cpp file as shown here...
(I think they were 64/40(?) by default)
Anyway - fastforward to today when I am updating a sketch and I happen to look at the https://www.pjrc.com/teensy/td_uart.html page which gives this info about a couple of commands...
I have used it and tested the writebuffer change with availableForWrite() with and without the addMemoryForWrite in the code.
My question is - Is the historical method of updating the .cpp files for each serial port rendered redundant by the addMemoryForWrite/Read options? I remembered that I had to update the cpp files each time I reinstalled Teensduino in the past so it wasn't a good experience - but before I back out those changes and just use the inline code options I wanted to make sure they are doing the same things as the .cpp file changes.
Cheers - N
Code:
#ifndef SERIAL1_TX_BUFFER_SIZE
#define SERIAL1_TX_BUFFER_SIZE 250 // number of outgoing bytes to buffer
#endif
#ifndef SERIAL1_RX_BUFFER_SIZE
#define SERIAL1_RX_BUFFER_SIZE 128 // number of incoming bytes to buffer
(I think they were 64/40(?) by default)
Anyway - fastforward to today when I am updating a sketch and I happen to look at the https://www.pjrc.com/teensy/td_uart.html page which gives this info about a couple of commands...
Code:
Serial1.addMemoryForRead(buffer, size)
Increase the amount of buffer memory between reception of bytes by the serial hardware and the
available() and read() functions. This is useful when your program must spend lengthy times performing
other work, like writing to a SD card, before it can return to reading the incoming serial data.
The buffer array must be a global or static variable.
Serial1.addMemoryForWrite(buffer, size)
Increase the amount of buffer memory between print(), write() and actual hardware serial transmission.
This can be useful when your program needs to print or write a large amount of data, without waiting.
The buffer array must be a global or static variable.
I have used it and tested the writebuffer change with availableForWrite() with and without the addMemoryForWrite in the code.
My question is - Is the historical method of updating the .cpp files for each serial port rendered redundant by the addMemoryForWrite/Read options? I remembered that I had to update the cpp files each time I reinstalled Teensduino in the past so it wasn't a good experience - but before I back out those changes and just use the inline code options I wanted to make sure they are doing the same things as the .cpp file changes.
Cheers - N