was not properly ref byteBuff
This commit is contained in:
parent
ddd4e8a269
commit
21f8ff6ee3
1 changed files with 5 additions and 4 deletions
|
@ -7,6 +7,7 @@ PhysicalLayer::PhysicalLayer(float step, size_t maxLen) {
|
||||||
#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
||||||
this->bufferBitPos = 0;
|
this->bufferBitPos = 0;
|
||||||
this->bufferWritePos = 0;
|
this->bufferWritePos = 0;
|
||||||
|
this->byteBuff = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,16 +434,16 @@ void PhysicalLayer::updateDirectBuffer(uint8_t bit) {
|
||||||
} else {
|
} else {
|
||||||
//save the bit
|
//save the bit
|
||||||
if(bit) {
|
if(bit) {
|
||||||
byteBuff |= 0x01 << this->bufferBitPos;
|
this->byteBuff |= 0x01 << this->bufferBitPos;
|
||||||
} else {
|
} else {
|
||||||
byteBuff &= ~(0x01 << this->bufferBitPos);
|
this->byteBuff &= ~(0x01 << this->bufferBitPos);
|
||||||
}
|
}
|
||||||
this->bufferBitPos++;
|
this->bufferBitPos++;
|
||||||
|
|
||||||
// check complete byte
|
// check complete byte
|
||||||
if(this->bufferBitPos == 8) {
|
if(this->bufferBitPos == 8) {
|
||||||
this->buffer[this->bufferWritePos] = Module::reflect(byteBuff, 8);
|
this->buffer[this->bufferWritePos] = Module::reflect(this->byteBuff, 8);
|
||||||
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("R\t%X", byteBuff);
|
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("R\t%X", this->byteBuff);
|
||||||
|
|
||||||
this->byteBuff = 0;
|
this->byteBuff = 0;
|
||||||
this->bufferWritePos++;
|
this->bufferWritePos++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue