From 8aee801028620cfbc3d21c5e1751cbdcbd4d2098 Mon Sep 17 00:00:00 2001 From: Adrian Del Grosso <10929341+ad3154@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:19:07 -0600 Subject: [PATCH] Fixed parsing of monochrome picture graphic IOP data Fixed an issue where bits in a monochrome bitmap were interpreted in reverse, causing monochrome picture graphics would appear corrupted. --- .../isobus_virtual_terminal_server_managed_working_set.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isobus/src/isobus_virtual_terminal_server_managed_working_set.cpp b/isobus/src/isobus_virtual_terminal_server_managed_working_set.cpp index c3170641..d16c0b32 100644 --- a/isobus/src/isobus_virtual_terminal_server_managed_working_set.cpp +++ b/isobus/src/isobus_virtual_terminal_server_managed_working_set.cpp @@ -2317,7 +2317,7 @@ namespace isobus { for (std::uint_fast8_t k = 0; k < 8U; k++) { - tempObject->add_raw_data((iopData[1] >> k) & 0x01); + tempObject->add_raw_data(static_cast(0 != ((iopData[1]) & (1 << (7 - k))))); lineAmountLeft--; if (0 == lineAmountLeft) @@ -2393,7 +2393,7 @@ namespace isobus { for (std::uint_fast8_t j = 0; j < 8U; j++) { - tempObject->add_raw_data((iopData[0] >> j) & 0x01); + tempObject->add_raw_data(static_cast(0 != ((iopData[0]) & (1 << (7 - j))))); lineAmountLeft--; if (0 == lineAmountLeft)