Thanks for the comments and instructions. As I wrote earlier, I made a fork, cloned and am doing my changes so that I can push (?) the changes to Git.
I managed to add the RX8 functionality and compile, so here is a step by step (non-coder) instruction for anybody who is attempting the same:
1. Check that you can compile the original project before making any modifications by navigating to the project folder with a terminal and typing make get -deps and then make. If it works, you should find newly updated .bin and .hex files in the project folder.
2. Add new object to the Makefile in OBJSL, e.g.,
3. Make a header file for your new vehicle, e.g., MAZDA_RX8.h (You can copy an existing one and make your modifications as needed)
3.1. To enable compilation, you need to include at least these:
Code: Select all
Public:
bool Ready() { return true; }
void SetRevCounter(int speed) { revCounter = speed; }
void SetTemperatureGauge(float temp) { temperature = temp; }
Private:
int revCounter;
float temperature;
4. Make a source file for your new vehicle, e.g., MAZDA_RX8.c (You can copy an existing one and make your modifications as needed)
5. Modify param_prj.h
5.1. Increase VEHMODES MAX value by 1
5.2. Add new vehicle to "define VEHMODES", e.g., <VEHMODES MAX value>=MAZDA_RX8
5.3. Add new vehicle to "enum vehicles", e.g., vMAZDA_RX8 = <VEHMODES MAX value>
6. Modify stm32_vcu.c
6.1. Declear the header file, e.g.,
6.2. Instantiate a new class, e.g.,
6.3. Add new vehicle to switch in function "static void UpdateVehicle()", e.g.,
Code: Select all
case vehicles::vMAZDA_RX8:
selectedVehicle = &rx8Vehicle;
break;
7. Save all modified files and compile with "make"