forked from MobiFlight/MobiFlight-Connector
-
Notifications
You must be signed in to change notification settings - Fork 0
How to set up a custom device
elral edited this page Sep 9, 2023
·
28 revisions
First of all, it is assumed that you have properbly installed PlatformIO under VSCode. If not, it is the right time to do this. Next clone the firmware reposority and create a new branch for your custom device. Follow the next steps carefully!
- A new folder under
/CustomDevicesis required. The foldername should be your (company)Name. This helps to have a better overview between multiple custom device from different users. - Copy the
_templatefolder into your newly created folder from step 1 and rename this folder to your device name. - Rename
MyCustomClass.cppandMyCustomClass.hto a name which fits to your custom device. - Rename
MyCustomDevice_platformio.inito a name which fits to your custom device (see step 3) but keep_platformio.ini. - Adapt the include path's from
MyCustomClass.cpp,MFCustomDevice.handMFCustomDevice.cppfrom#include MyCustomClass.hto#include YourChangedName.h - Adapt the
YourChangedName_platformio.ini:
- Decide which board should be supported. The _template is set up for the Mega and Pico. Is one of them is not needed, delete this part which is called in the following environment.
- rename each required environment from
[env:mobiflight_template_mega]to your custom device. It should be like [env:YourName_YourCustomDevice_board] -
-I./CustomDevices/_templateunderbuild_flagsto your choosed folder name for all environments. -
+<../CustomDevices/_template>underbuild_src_filterto your choosed folder name for all environments.
- Adapt the
platformio.ini:
- add your
YourChangedName_platformio.iniunderextra_configs =with the complete path, like./CustomDevices/YourFolderName/YourDeviceNameFolder/YourChangedName_platformio.ini
Now it's time to test all these settings. Open a teminal window in PlatformIO and type pio run. This will compile all environments defined in platformio.ini including your newly defined environments. If everything is setup correct, no failure should be reported.
es fehlt noch:
- board.json *device.json *mobiflight_type