Template repository for building an ESP app with ESP++ (espp) components and ESP-IDF components.
This repository is designed to be used as a template repository - so you can sepcify this as the template repository type when creating a new repository on GitHub.
After setting this as the template, make sure to update the following:
- This README to contain the relevant description and images of your project
- The ./CMakeLists.txt file to have the components that you want to use (and any you may have added to the components folder) as well as to update the project name
- The ./main/main.cpp To run the main code for your app. The main folder is also where you can put additional header and source files that you don't think belong in their own components but help keep the main code clean.
Since this repo contains a submodule, you need to make sure you clone it recursively, e.g. with:
git clone --recurse-submodules <your repo name>
Alternatively, you can always ensure the submodules are up to date after cloning (or if you forgot to clone recursively) by running:
git submodule update --init --recursive
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor
(Replace PORT with the name of the serial port to use.)
(To exit the serial monitor, type Ctrl-]
.)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
Example screenshot of the console output from this app:
If you're developing code for this repository, it's recommended to configure your development environment:
- Ensure
clang-format
is installed - Ensure pre-commit is installed
- Set up
pre-commit
for this repository:
pre-commit install
This helps ensure that consistent code formatting is applied, by running
clang-format
each time you change the code (via a git pre-commit hook) using
the ./.clang-format code style configuration file.
If you ever want to re-run the code formatting on all files in the repository, you can do so:
pre-commit run --all-files