ESP-MDF Contributions Guide


This guide introduces how to add code to ESP-MDF. For details, please refer to Contributions Guide.

Add Code

When you add new functions to ESP-MDF, please add the corresponding examples as well to the directory examples. Also, please add two variables ARTIFACTS_NAME and EXAMPLE_PATH to the file .gitlab-ci.yml, and test the examples in gitlab. Please refer to the get_started example below:

  <<: *build_template
    ARTIFACTS_NAME: "get_started"
    EXAMPLE_PATH: "examples/get_started"

Format Code

Make sure to format the code prior to your submission, with either one of the formatting tools for ESP-MDF: astyle and dos2unix. Please install such tools first. For the installation on Linux, please refer to the command below:

sudo apt-get install astyle
sudo apt-get install dos2unix

Run the code formatting command below:

tools/ new_file.c

Generate API Documentation

For the code comments, please follow the Doxygen Manual. You may use Doxygen to automatically generate API documentation according to the following steps:

sudo apt-get install doxygen
export MDF_PATH=~/esp/esp-mdf
cd ~/esp/esp-mdf/docs
pip install -r requirements.txt
cd ~/esp/esp-mdf/docs/en
make html