Skip to content

Merge CAN_FRAME and CAN_FRAME_FD #5

@driftregion

Description

@driftregion

It'd be elegant if there was a single CAN_FRAME class.
I think the largest reason against doing this is that a CAN_FRAME_FD structure requires about 4x more memory than a CAN_FRAME.

CAN_FRAME_FD is 64 + 12 + 5 = 81 bytes
CAN_FRAME is 8 + 12 + 4 = 24 bytes
The ESP32 has 520KiB of RAM, enough for about 6000 CAN_FRAME_FD or 20,000 CAN_FRAME.

Since most applications probably won't ever store more than about 100 frames in memory at once, it seems reasonable to merge these two classes.

I'm not using CAN FD at the moment, so there are probably plenty of things I haven't considered. What do you think about this idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions