From 21f8ff6ee3d6fa87bfa3afaa488a14810d389138 Mon Sep 17 00:00:00 2001 From: Crsarmv7l <85343771+Crsarmv7l@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:32:01 -0400 Subject: [PATCH] was not properly ref byteBuff --- src/protocols/PhysicalLayer/PhysicalLayer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.cpp b/src/protocols/PhysicalLayer/PhysicalLayer.cpp index 152c37d0..1cc9c9c6 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.cpp +++ b/src/protocols/PhysicalLayer/PhysicalLayer.cpp @@ -7,6 +7,7 @@ PhysicalLayer::PhysicalLayer(float step, size_t maxLen) { #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE this->bufferBitPos = 0; this->bufferWritePos = 0; + this->byteBuff = 0; #endif } @@ -433,16 +434,16 @@ void PhysicalLayer::updateDirectBuffer(uint8_t bit) { } else { //save the bit if(bit) { - byteBuff |= 0x01 << this->bufferBitPos; + this->byteBuff |= 0x01 << this->bufferBitPos; } else { - byteBuff &= ~(0x01 << this->bufferBitPos); + this->byteBuff &= ~(0x01 << this->bufferBitPos); } this->bufferBitPos++; // check complete byte if(this->bufferBitPos == 8) { - this->buffer[this->bufferWritePos] = Module::reflect(byteBuff, 8); - RADIOLIB_DEBUG_PROTOCOL_PRINTLN("R\t%X", byteBuff); + this->buffer[this->bufferWritePos] = Module::reflect(this->byteBuff, 8); + RADIOLIB_DEBUG_PROTOCOL_PRINTLN("R\t%X", this->byteBuff); this->byteBuff = 0; this->bufferWritePos++;