make the pad 3 -> logic consistent

This commit is contained in:
ryleu
2026-04-07 23:44:38 -05:00
parent b09b55bee0
commit 0a257abf43

View File

@@ -372,10 +372,10 @@ class CANConnector(Connector):
case 2: case 2:
data_type = 1 data_type = 1
data = struct.pack(">ff", *msg.data) 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 data_type = 2
# pad till we have 4 otherwise struct.pack will freak out if data_len == 3:
msg.data.append(0) msg.data.append(0)
msg.data = msg.data[:4] msg.data = msg.data[:4]
data = struct.pack(">hhhh", *[int(x) for x in msg.data]) data = struct.pack(">hhhh", *[int(x) for x in msg.data])
case _: case _: