From c14c68f2febea057cd5dca8f6193cded3838284e Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Wed, 26 Aug 2015 18:19:02 -0400 Subject: [PATCH] Correct math bug in big endian calcs (for dbc) --- dbchandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbchandler.cpp b/dbchandler.cpp index 9a4c5b2..39a361c 100644 --- a/dbchandler.cpp +++ b/dbchandler.cpp @@ -566,7 +566,7 @@ QString DBCHandler::processSignal(const CANFrame &frame, const DBC_SIGNAL &sig) for (int bitpos = 0; bitpos < sigSize; bitpos++) { if (frame.data[bit / 8] & (1 << (bit % 8))) - result += (1ULL << (sigSize - bitpos)); + result += (1ULL << (sigSize - bitpos - 1)); if ((bit % 8) == 0) bit += 15;