Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
skip = *.gif,*.jpg,*.jpeg,*.pdf,*.png,*.svg,build
48 changes: 48 additions & 0 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Pre-Commit Checks

on:
pull_request:
push:
branches: [master, main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install pre-commit
run: pip install pre-commit

- name: Get modified files
id: modified_files
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE_BRANCH="${{ github.base_ref }}"
git fetch origin "$BASE_BRANCH" --depth=1
MODIFIED_FILES="$(git diff --name-only "origin/$BASE_BRANCH"...HEAD || echo "")"
else
MODIFIED_FILES="$(git diff --name-only HEAD~1 HEAD || echo "")"
fi

if [ -n "$MODIFIED_FILES" ]; then
echo "Running pre-commit on changed files:"
echo "$MODIFIED_FILES"
echo "files=$(echo "$MODIFIED_FILES" | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
echo "has_files=true" >> "$GITHUB_OUTPUT"
else
echo "No modified files to check."
echo "has_files=false" >> "$GITHUB_OUTPUT"
fi

- name: Run pre-commit on modified files
if: steps.modified_files.outputs.has_files == 'true'
run: pre-commit run --files ${{ steps.modified_files.outputs.files }}
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args: [--config=.codespellrc]
files: ^(docs/|README(_cn)?\.md$)
2 changes: 1 addition & 1 deletion docs/en/rst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ gh-linkcheck:
'https://github.com/espressif/esp-idf/tree\|https://github.com/espressif/esp-idf/blob\|https://github.com/espressif/esp-idf/raw'\
); \
then \
echo "WARNINIG: Some .rst files contain hardcoded Github links."; \
echo "WARNING: Some .rst files contain hardcoded Github links."; \
echo "Please check above output and replace links with one of the following:"; \
echo "- :idf:\`dir\` - points to directory inside ESP-IDF"; \
echo "- :idf_file:\`file\` - points to file inside ESP-IDF"; \
Expand Down
2 changes: 1 addition & 1 deletion docs/en/rst/communication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ For the detailed usage, please refer to the code ``\components\drivers\general\w

.. note::

Before Wi-Fi initialization, please use ``WIFI_INIT_CONFIG_DEFAULT`` to obtain the initialization configuration struct, and customize this struct first, then start the initialization. Be aware of problems caused by unitialized members of the struct, and pay special attention to this issue when new structure members are added to the ESP-IDF during update.
Before Wi-Fi initialization, please use ``WIFI_INIT_CONFIG_DEFAULT`` to obtain the initialization configuration struct, and customize this struct first, then start the initialization. Be aware of problems caused by uninitialized members of the struct, and pay special attention to this issue when new structure members are added to the ESP-IDF during update.

**AP Mode Workflow**

Expand Down
18 changes: 9 additions & 9 deletions docs/en/rst/getespidf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ Set up Development Environment
================================
:link_to_translation:`zh_CN:[中文]`

Set up ESP-IDF Environment
Set up ESP-IDF Environment
---------------------------------

Please refer to `ESP-IDF Programming Guide <https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32s2/get-started/index.html>`__\ and set up ESP-IDF environmnet step by step.
Please refer to `ESP-IDF Programming Guide <https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32s2/get-started/index.html>`__\ and set up ESP-IDF environment step by step.

.. note::

- ESP-IDF branch ``release/v5.0`` is suggested.
- Please follow and complete all setup steps.
- Build a example of ESP-IDF to make sure the setup is successful.
- Build an example of ESP-IDF to make sure the setup is successful.


Get Project Source Code
Get Project Source Code
---------------------------------------------------

**Beta code, currently in the GitHub repository, is available by using git:**
Expand All @@ -26,7 +26,7 @@ Get Project Source Code
**The project software mainly consists of a flight control kernel, hardware drivers, and dependency libraries:**

- The flight control kernel is from Crazyflie, mainly including hardware abstraction layer and flight control program.
- Hardware drivers are structured in files according to hardware interfaces, including I2C devcies and SPI devices.
- Hardware drivers are structured in files according to hardware interfaces, including I2C devices and SPI devices.
- Dependency libraries include the default components provided by ESP-IDF, as well as DSP from third parties.

**The code file structure is as follows:**
Expand All @@ -47,9 +47,9 @@ Get Project Source Code
│   ├── core | system kernel directory
│   │   └── crazyflie | Crazyflie kernel
│   │   ├── hal | hardware abstraction code
│   │   └── modules | flight control code
│   │   └── modules | flight control code
│   ├── drivers | hardware driver directory
│   │   ├── deck | hardware extention interface driver
│   │   ├── deck | hardware extension interface driver
│   │   ├── general | general device directory
│   │   │   ├── adc | ADC driver for voltage monitoring
│   │   │   ├── buzzer | buzzer driver for status feedback
Expand All @@ -76,7 +76,7 @@ Get Project Source Code
├── README.md | project description
└── sdkconfig.defaults | default parameter

**For more information, please refer to**: `espdrone_file_structure <./_static/espdrone_file_structure.pdf>`__.
**For more information, please refer to**: `espdrone_file_structure <./_static/espdrone_file_structure.pdf>`__.

Source Code Style
--------------------
Expand All @@ -102,7 +102,7 @@ The first member in an enumeration defaults to 0, so the member SensorImplementa

.. code:: text

typedef enum {
typedef enum {
#ifdef SENSOR_INCLUDED_BMI088_BMP388
SensorImplementation_bmi088_bmp388,
#endif
Expand Down
4 changes: 2 additions & 2 deletions docs/en/rst/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ Tune Online Parameters

.. figure:: ../../_static/cfclient_pid_tune.png
:align: center
:alt: PID parameters tunning
:alt: PID parameters tuning
:figclass: align-center

Cfclient PID Parameters Tunning
Cfclient PID Parameters Tuning


**Note**
Expand Down
2 changes: 1 addition & 1 deletion docs/zh_CN/rst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ gh-linkcheck:
'https://github.com/espressif/esp-idf/tree\|https://github.com/espressif/esp-idf/blob\|https://github.com/espressif/esp-idf/raw'\
); \
then \
echo "WARNINIG: Some .rst files contain hardcoded Github links."; \
echo "WARNING: Some .rst files contain hardcoded Github links."; \
echo "Please check above output and replace links with one of the following:"; \
echo "- :idf:\`dir\` - points to directory inside ESP-IDF"; \
echo "- :idf_file:\`file\` - points to file inside ESP-IDF"; \
Expand Down
Loading