From 0a257abf43c6360b992b751726b47356ce4a91f3 Mon Sep 17 00:00:00 2001 From: ryleu <69326171+ryleu@users.noreply.github.com> Date: Tue, 7 Apr 2026 23:44:38 -0500 Subject: [PATCH] make the pad 3 -> logic consistent --- src/anchor_pkg/anchor_pkg/connector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/anchor_pkg/anchor_pkg/connector.py b/src/anchor_pkg/anchor_pkg/connector.py index 14a9065..d2a6bb5 100644 --- a/src/anchor_pkg/anchor_pkg/connector.py +++ b/src/anchor_pkg/anchor_pkg/connector.py @@ -372,10 +372,10 @@ class CANConnector(Connector): case 2: data_type = 1 data = struct.pack(">ff", *msg.data) - case 3 | 4: # 3 gets padded and is treated as 4 + case 3 | 4: # 3 gets treated as 4 data_type = 2 - # pad till we have 4 otherwise struct.pack will freak out - msg.data.append(0) + if data_len == 3: + msg.data.append(0) msg.data = msg.data[:4] data = struct.pack(">hhhh", *[int(x) for x in msg.data]) case _: