Skip to content

Split CAN comms into source and header files#2404

Open
yuzeguitarist wants to merge 3 commits into
commaai:masterfrom
yuzeguitarist:codex/source-header-can-comms
Open

Split CAN comms into source and header files#2404
yuzeguitarist wants to merge 3 commits into
commaai:masterfrom
yuzeguitarist:codex/source-header-can-comms

Conversation

@yuzeguitarist
Copy link
Copy Markdown

@yuzeguitarist yuzeguitarist commented May 21, 2026

Summary

This is a small, mechanical source/header split toward #2171:

  • move the CAN host transport implementation out of board/can_comms.h and into board/can_comms.c
  • keep board/can_comms.h declaration-only
  • move main firmware global state definitions from board/main_definitions.h into board/main_state.c
  • extract the CAN comms bulk-transfer sizing constants into board/comms_constants.h
  • wire the new C files into the firmware and tests/libpanda builds

No protocol or behavior changes are intended.

Validation

Local:

  • scons -j2
  • ruff check .
  • pytest tests/usbprotocol/test_comms.py tests/usbprotocol/test_pandalib.py -q
  • pytest -q --ignore=tests/misra
  • git diff --check

GitHub Actions:

  • ./test.sh (macos-latest) passed
  • ./test.sh (ubuntu-latest) passed
  • build passed
  • windows pip package test passed

Refs #2171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant