Check bufferWritePos if too large set to 0
This commit is contained in:
parent
3f357b5f1f
commit
7b348fae33
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue