107-systems / 107-Arduino-MCP2515

Arduino library for controlling the MCP2515 in order to receive/transmit CAN frames.
https://107-systems.org
MIT License
90 stars 14 forks source link

Support libcanard defined types for receiving/transmitting #17

Closed aentinger closed 4 years ago

aentinger commented 4 years ago

This PR adds the feature of automatically supporting the libcanard defined CanardFrame type for receiving/transmitting of CAN frames when libcanard is present in the build project. Therefore this PR prepares the repository being included in UAVCAN/platform_specific_components as dicusssed in https://github.com/UAVCAN/platform_specific_components/issues/15 .

What do you think @pavel-kirienko ?

github-actions[bot] commented 4 years ago

Memory usage change @ afb9e56314d0a02760f17b9044730c18531b1fa4

Board flash % RAM for global variables %
arduino:samd:mkrvidor4000 :green_heart: -12 - -8 -0.0 - -0.0 0 - 0 0.0 - 0.0
Click for full report table Board|examples/MCP2515-CAN-Sniffer
flash|%|examples/MCP2515-CAN-Sniffer
RAM for global variables|%|examples/MCP2515-Loopback
flash|%|examples/MCP2515-Loopback
RAM for global variables|% -|-|-|-|-|-|-|-|- arduino:samd:mkrvidor4000|-12|-0.0|0|0.0|-8|-0.0|0|0.0
Click for full report CSV ``` Board,examples/MCP2515-CAN-Sniffer
flash,%,examples/MCP2515-CAN-Sniffer
RAM for global variables,%,examples/MCP2515-Loopback
flash,%,examples/MCP2515-Loopback
RAM for global variables,% arduino:samd:mkrvidor4000,-12,-0.0,0,0.0,-8,-0.0,0,0.0 ```
pavel-kirienko commented 4 years ago

I think it's fine but shouldn't you include canard.h instead of libcanard/canard.h for compatibility with libcanard itself? In canard.c it says #include "canard.h".

aentinger commented 4 years ago

You are right about this. I've chosen (had to choose) libcanard/canard.h because that's the way it has been included in 107-Arduino-UAVCAN and it won't work otherwise. However, I think there's a way that will make both of us happy. :hourglass_flowing_sand:

EDIT: https://github.com/107-systems/107-Arduino-MCP2515/pull/17/commits/cab8a8879fccf3e566dbaeba190e0bb60bc36288 This should satisfy both our needs. What do you think @pavel-kirienko?

github-actions[bot] commented 4 years ago

Memory usage change @ cab8a8879fccf3e566dbaeba190e0bb60bc36288

Board flash % RAM for global variables %
arduino:samd:mkrvidor4000 :small_red_triangle: +96 - +100 +0.04 - +0.04 :small_red_triangle: +16 - +16 +0.05 - +0.05
Click for full report table Board|examples/MCP2515-CAN-Sniffer
flash|%|examples/MCP2515-CAN-Sniffer
RAM for global variables|%|examples/MCP2515-Loopback
flash|%|examples/MCP2515-Loopback
RAM for global variables|% -|-|-|-|-|-|-|-|- arduino:samd:mkrvidor4000|96|0.04|16|0.05|100|0.04|16|0.05
Click for full report CSV ``` Board,examples/MCP2515-CAN-Sniffer
flash,%,examples/MCP2515-CAN-Sniffer
RAM for global variables,%,examples/MCP2515-Loopback
flash,%,examples/MCP2515-Loopback
RAM for global variables,% arduino:samd:mkrvidor4000,96,0.04,16,0.05,100,0.04,16,0.05 ```