Skip to content

Latest commit

 

History

History
20 lines (10 loc) · 2.79 KB

github_magic.md

File metadata and controls

20 lines (10 loc) · 2.79 KB

GitHub Magic

Git and GitHub are seperate entities. GitHub is source control repository hosting.
The main value they do provide is in establishing some security gates, allowing code reviews via pull requests and a platform for hashing out discussions on code changes and tracking issues. Due to its popularity, learning the lingo and how to navigate the interface, along with how it is manipulating git behind the scenes is a feather in your cap for any young engineer.

A feature they've rolled out more recently is Github Actions which provides a basic form of CI/CD. This allows git pushes to the server and interaction with the gui to trigger tasks that take manual work off your plate.

Autogenerated CAN Interface Files

The .dbc file that use used to define the CAN communication network for the vehicle resides in the dbc folder. This repository will automatically generate the .c and .h files needed for packing and unpacking CAN bus Messages. There are some guidelines on how you should edit the .dbc file so as not to upset the rest of the team.

At every push to the github server, a Github Action will fire, checking if any files in the dbc directory have changed. If they have, it will run and overwrite the output in the can_conv directory. It will then commit the changes.

The underlying code used for the conversion can be seen here. Please note the restriction on 8 byte. I think the 8-bites noted on the first paragraph is supposed to be bytes.

There is a limitation on this. Only a single can .dbc file can be used across a single executable. So if you have more than one CAN bus network, all messages need to reside in a single file. Other libraries don't do that but they are slower. One network is plenty for this car.

DANGER: As noted in other locations, it's very important that you not rename the .dbc file or any signals or messages in it. Modifying existing message and signal names will cause breaking changes that you'll need to fix to get code using those signals to compile again. See here for more details.

Automated Builds

After checking, and updating the CAN code if required, the GitHub Action moves on to searching the repository for any files ending in .ino which is an Arduino sketch file. At the moment it is building the sketches against the board definition for the Adafruit Feather M4 CAN. For the automated builds, libraries are managed by the yaml file in the root. Be sure to get the proper syntax for the name of the library you're using and add it here and the builds will be verified automatically.