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

Simplify CAN callbacks to use bytes rather than 32-bit words #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davefiddes
Copy link
Contributor

Virtually all CAN callbacks cast the two 32-bit words the libopeninv library presents an incoming CAN
frame in to bytes. Rather than repeat this cast all over the place replace with one central cast and change the interface of the DecodeCAN callback methods.

The exceptions which require reverse casts of byte- arrays back to 32-bit words are:

  • FCChademo
  • E65_Lever
  • OutlanderInverter

These could be changed to access the bytes directly but this would require greater understanding and testing of the code.

The changes are mechanical in nature and should not affect the operation of the code.

Where applicable "override" is used for virtual methods to make it clear to the compiler that virtual functions are being overridden.

Tests:

  • Build for STM32 and Linux

Virtually all CAN callbacks cast the two 32-bit words
the libopeninv library presents an incoming CAN
frame in to bytes. Rather than repeat this cast all over
the place replace with one central cast and change
the interface of the DecodeCAN callback methods.

The exceptions which require reverse casts of byte-
arrays back to 32-bit words are:
 - FCChademo
 - E65_Lever
 - OutlanderInverter

These could be changed to access the bytes directly but
this would require greater understanding and testing of
the code.

The changes are mechanical in nature and should not
affect the operation of the code.

Where applicable "override" is used for virtual methods
to make it clear to the compiler that virtual functions
are being overridden.

Tests:
 - Build for STM32 and Linux
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