Correct math bug in big endian calcs (for dbc)

This commit is contained in:
Collin Kidder
2015-08-26 18:19:02 -04:00
parent 4d498bf0be
commit c14c68f2fe
+1 -1
View File
@@ -566,7 +566,7 @@ QString DBCHandler::processSignal(const CANFrame &frame, const DBC_SIGNAL &sig)
for (int bitpos = 0; bitpos < sigSize; bitpos++) for (int bitpos = 0; bitpos < sigSize; bitpos++)
{ {
if (frame.data[bit / 8] & (1 << (bit % 8))) if (frame.data[bit / 8] & (1 << (bit % 8)))
result += (1ULL << (sigSize - bitpos)); result += (1ULL << (sigSize - bitpos - 1));
if ((bit % 8) == 0) if ((bit % 8) == 0)
bit += 15; bit += 15;