This repository contains the source code that the SAE team at IIT uses for their microcontrollers.
For new members that are just joining, please refer to the CONTRIBUTING file.
- Teensy 3.6 x 2
- A Windows machine (Preferably Win 10)
- A Formula Hybrid Car (Not necessary for testing)
- A Compatible CAN transceiver x 2
This project assumes you installed the latest version of the following.
- VSCode
- This template is based around VSCode
- Python
- At least python 3.10.x
- Ensure python files are executed by default when opening them in a CLI
- CMake
- Make sure to select the
add CMake to path
option when installing
- Make sure to select the
- Git
- For version control of this repository
Clone TeensyToolchain alongside this folder.
If it is not named already, rename the cloned/downloaded folder to TeensyToolchain
e.g. TeensyToolchain-master
-> TeensyToolchain
Alternatively, you can modify the TOOLCHAIN_OFFSET
option inside .vscode/settings.json
in order to tell the project where the toolchain is. This path is relative to this folder.
Main logic is either in src/ECUStates.cpp
or src/Front.cpp
Put any libraries / modules in the libraries
folder
VS setup
: Configure things such as whatCOM
ports to use; both for front and back teensy, whether to use the plotter app, and whether to compile for teensy3.6
,4.0
, or4.1
.Clean
: Clean up build filesReset
: Clean up entire CMake project and reconfigure CMakeBuild
: Compile project and generate binariesUpload
: Upload compiled binary to either front or back teensyMonitor
: Monitor teensy over a CLI, select the appropriate options when running, defaults toMapped
mode
By default, Ctrl + Shift + B
(Run Build Task) should run Build
then Upload
for both Teensies and then Monitor
.
Alternatively, install the Tasks extension so that the main tasks appear on the status bar.
There are more tasks but these are the most important ones.
You can modify the set values and compile flags inside CmakeLists.txt
if you know what you are doing.
They are mostly under the function calls add_compile_definitions
and add_compile_options
towards the beginning.
This project uses Doxygen to auto generate documentation.
Doxygen Extensions exist for VSCode, to easily compile and view inside VSCode.
The documentation can be generated locally or you can view the auto generated Github Page for this repo.