Skip to content

How to set up a custom device

elral edited this page Sep 10, 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!

  1. A new folder under /CustomDevices is required. The foldername should be your (company)Name. This helps to have a better overview between multiple custom device from different users.
  2. Copy the _template folder into your newly created folder from step 1 and rename this folder to your device name.
  3. Rename MyCustomClass.cpp and MyCustomClass.h to a name which fits to your custom device.
  4. Rename MyCustomDevice_platformio.ini to a name which fits to your custom device (see step 3) but keep _platformio.ini, e.g. YourChangedName_platformio.ini
  5. Change the include path's from MyCustomClass.cpp, MFCustomDevice.h and MFCustomDevice.cpp from #include MyCustomClass.h to #include YourChangedName.h
  6. 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]
  • change -I./CustomDevices/_template under build_flags to your choosed folder name for all environments.
  • change +<../CustomDevices/_template> under build_src_filter to your choosed folder name for all environments.
  • change '-DMOBIFLIGHT_TYPE="Mobiflight Template Mega"' to your needs. It should be like '-DMOBIFLIGHT_TYPE="YourName YourDevice board"'. This is important and this must match with "MobiFlightType" within the .json files (see below)
  1. Adapt the platformio.ini:
  • add your YourChangedName_platformio.ini under extra_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

Installation

User Interface

Clone this wiki locally