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

limit CAN-ID to 29 bit #27

Closed generationmake closed 3 years ago

generationmake commented 3 years ago

in the CAN-ID variable sometimes bit 31 is set. This causes problems in libcanard. So the id needs to be limited to 29 bit and the other 3 bits need to be dropped.

github-actions[bot] commented 3 years ago

Memory usage change @ 7fe011f0c1ad26c710dd310b96efe72d6e97ab8c

Board flash % RAM for global variables %
arduino:mbed:envie_m4 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:nano33ble 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 :small_red_triangle: +4 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero :small_red_triangle: +4 - +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:mbed:envie_m4|0|0.0|0|0.0|0|0.0|0|0.0 arduino:mbed:envie_m7|0|0.0|0|0.0|0|0.0|0|0.0 arduino:mbed:nano33ble|0|0.0|0|0.0|0|0.0|0|0.0 arduino:samd:mkr1000|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrfox1200|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrgsm1400|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrnb1500|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrvidor4000|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrwan1300|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrwan1310|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrwifi1010|8|0.0|0|0.0|4|0.0|0|0.0 arduino:samd:mkrzero|8|0.0|0|0.0|4|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:mbed:envie_m4,0,0.0,0,0.0,0,0.0,0,0.0 arduino:mbed:envie_m7,0,0.0,0,0.0,0,0.0,0,0.0 arduino:mbed:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0 arduino:samd:mkr1000,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrfox1200,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrgsm1400,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrnb1500,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrvidor4000,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrwan1300,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrwan1310,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrwifi1010,8,0.0,0,0.0,4,0.0,0,0.0 arduino:samd:mkrzero,8,0.0,0,0.0,4,0.0,0,0.0 ```
generationmake commented 3 years ago

Hi @aentinger This is also OK for me. I was happy to find a quick solution for the problem. I changed the files and a short test was successful.