Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CAN3 printer #1991

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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):
Expand Down
5 changes: 5 additions & 0 deletions tests/can_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading