I should have added that now that you mention it.
For those unaware. If you want to add your own files simply do this.
Navigate to the core-firmware folder, then src. in there you will find a file called “build.mk”. Double click on it to open it. In there you will notice the start of the following:
C++ source files included in this build.
CPPSRC += $(TARGET_SRC_PATH)/application.cpp
CPPSRC += $(TARGET_SRC_PATH)/main.cpp
CPPSRC += $(TARGET_SRC_PATH)/newlib_stubs.cpp
CPPSRC += $(TARGET_SRC_PATH)/spark_utilities.cpp
CPPSRC += $(TARGET_SRC_PATH)/spark_wiring.cpp
All you need to do from here is create your new file, we will call ours my_test.cpp
Put the my_test.cpp in the core-firmware/src folder and the my_test.h in the core-firmware/inc folder.
then edit the build.mk file by adding your new file to it. add a new line to the start of the “CPPSRC += …” lines and add this:
CPPSRC += $(TARGET_SRC_PATH)/my_test.cpp
save it and your done.