Skip to content
Snippets Groups Projects
Commit 9eaee218 authored by kongr45gpen's avatar kongr45gpen
Browse files

Fix bug in Message::appendBits()

parent a2d5864d
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ void Message::appendBits(uint8_t numBits, uint16_t data) { ...@@ -20,7 +20,7 @@ void Message::appendBits(uint8_t numBits, uint16_t data) {
this->data[dataSize] |= static_cast<uint8_t>(data >> (numBits - bitsToAddNow)); this->data[dataSize] |= static_cast<uint8_t>(data >> (numBits - bitsToAddNow));
// Remove used bits // Remove used bits
data &= (1 << bitsToAddNow) - 1; data &= (1 << (numBits - bitsToAddNow)) - 1;
numBits -= bitsToAddNow; numBits -= bitsToAddNow;
currentBit = 0; currentBit = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment