Double VE.Direct receive buffer to avoid overflow (#1109)

This commit is contained in:
Niko 2024-07-16 08:15:11 +02:00 committed by GitHub
parent 926a0b992d
commit 0013b2c934
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,6 +66,7 @@ void VeDirectFrameHandler<T>::init(char const* who, int8_t rx, int8_t tx,
Print* msgOut, bool verboseLogging, uint8_t hwSerialPort) Print* msgOut, bool verboseLogging, uint8_t hwSerialPort)
{ {
_vedirectSerial = std::make_unique<HardwareSerial>(hwSerialPort); _vedirectSerial = std::make_unique<HardwareSerial>(hwSerialPort);
_vedirectSerial->setRxBufferSize(512); // increased from default (256) to 512 Byte to avoid overflow
_vedirectSerial->end(); // make sure the UART will be re-initialized _vedirectSerial->end(); // make sure the UART will be re-initialized
_vedirectSerial->begin(19200, SERIAL_8N1, rx, tx); _vedirectSerial->begin(19200, SERIAL_8N1, rx, tx);
_vedirectSerial->flush(); _vedirectSerial->flush();