Check bufferWritePos if too large set to 0

This commit is contained in:
Crsarmv7l 2024-05-05 16:15:28 -04:00 committed by GitHub
parent 3f357b5f1f
commit 7b348fae33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -435,6 +435,9 @@ void PhysicalLayer::updateDirectBuffer(uint8_t bit) {
// check complete byte
if(this->bufferBitPos == 8) {
if(this->bufferWritePos >= RADIOLIB_STATIC_ARRAY_SIZE) {
this->bufferWritePos = 0;
}
this->buffer[this->bufferWritePos] = Module::reflect(this->byteBuff, 8);
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("R\t%X", this->byteBuff);