From da70ea798df3c1948d78618fcfc47aac2dc7aaa7 Mon Sep 17 00:00:00 2001 From: Allan Bazinet Date: Fri, 27 Dec 2024 15:00:48 -0800 Subject: [PATCH] Simplify frame type insertion --- mainwindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 1f9e9bea..c2d73558 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -540,9 +540,7 @@ namespace // the next 3 bits in the byte array, i.e., the first 3 bits of // byte 9, after which we'll be at 75 bits in total. - bytes[9] |= ((((type & 0b001) << 2) | - ((type & 0b010)) | - ((type & 0b100) >> 2)) << 4); + bytes[9] = (type & 0b111) << 5; // We now need to compute the augmented CRC-12 of the complete // byte array, including the trailing zero bits that we've not