From 2b94e4fef710a22313b99d8c5b723d8db5e9c8bd Mon Sep 17 00:00:00 2001 From: dzid26 Date: Tue, 27 Aug 2024 00:15:29 +0000 Subject: [PATCH] Enable CAN3 printer (#1991) * panda has 3 can peripherals * enable printing CAN3 --- python/__init__.py | 2 +- tests/can_printer.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/__init__.py b/python/__init__.py index 837c8cc605..f982d3bcf5 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -22,7 +22,7 @@ CANPACKET_HEAD_SIZE = 0x6 DLC_TO_LEN = [0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64] LEN_TO_DLC = {length: dlc for (dlc, length) in enumerate(DLC_TO_LEN)} -PANDA_BUS_CNT = 4 +PANDA_BUS_CNT = 3 def calculate_checksum(data): diff --git a/tests/can_printer.py b/tests/can_printer.py index 08315560ed..70a18a61bd 100755 --- a/tests/can_printer.py +++ b/tests/can_printer.py @@ -17,7 +17,12 @@ def can_printer(): start = sec_since_boot() lp = sec_since_boot() msgs = defaultdict(list) + canbus = int(os.getenv("CAN", "0")) + if canbus == 3: + canbus = 1 + p.set_obd(True) + while True: can_recv = p.can_recv() for address, dat, src in can_recv: