Skip to content

Commit ee054bc

Browse files
committed
Merge branch 'master' of github.com:adafruit/arduino-esp32
2 parents 8935389 + 543fad2 commit ee054bc

File tree

315 files changed

+10059
-2096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+10059
-2096
lines changed

.codespellrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[codespell]
22
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check/.codespellrc
33
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4-
ignore-words-list = ba,licence,ot,dout,als,exten
4+
ignore-words-list = ba,licence,ot,dout,als,exten,emac
55
skip = ./.git,./.licenses,__pycache__,.clang-format,.codespellrc,.editorconfig,.flake8,.prettierignore,.yamllint.yml,.gitignore,boards.txt,platform.txt,programmers.txt
66
builtin = clear,informal,en-GB_to_en-US
77
check-filenames =

.github/ISSUE_TEMPLATE/Feature-request.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8+
* Please note that we can only process feature requests reported in English to ensure effective communication and support. Feature requests written in other languages will be closed, with a request to rewrite them in English.
89
* We welcome any ideas or feature requests! It is helpful if you can explain exactly why the feature would be useful.
910
* There are usually some outstanding feature requests in the [existing issues list](https://github.com/espressif/arduino-esp32/issues?q=is%3Aopen+is%3Aissue+label%3A%22Type%3A+Feature+request%22), feel free to add comments to them.
1011
* If you would like to contribute, please read the [contributions guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html).

.github/ISSUE_TEMPLATE/Issue-report.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8+
* Please note that we can only process issues reported in English to ensure effective communication and support. Issues written in other languages will be closed, with a request to rewrite them in English.
89
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
910
* Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html)
1011
* Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
@@ -39,8 +40,13 @@ body:
3940
label: Version
4041
description: What version of Arduino ESP32 are you running? If possible, consider updating to the latest version.
4142
options:
42-
- latest master (checkout manually)
43+
- latest stable Release (if not listed below)
4344
- latest development Release Candidate (RC-X)
45+
- latest master (checkout manually)
46+
- v3.2.0
47+
- v3.1.3
48+
- v3.1.2
49+
- v3.1.1
4450
- v3.1.0
4551
- v3.0.7
4652
- v3.0.6

.github/ISSUE_TEMPLATE/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Arduino ESP32 Gitter Channel
4-
url: https://gitter.im/espressif/arduino-esp32
5-
about: Community channel for questions and help
3+
- name: Arduino Core for Espressif Discord Server
4+
url: https://discord.gg/8xY6e9crwv
5+
about: Community Discord server for questions and help
66
- name: ESP32 Forum - Arduino
77
url: https://esp32.com/viewforum.php?f=19
88
about: Official Forum for questions

.github/scripts/on-push-idf.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CHECK_REQUIREMENTS="./components/arduino-esp32/.github/scripts/sketch_utils.sh check_requirements"
6+
7+
# Export IDF environment
8+
. ${IDF_PATH}/export.sh
9+
10+
# Find all examples in ./components/arduino-esp32/idf_component_examples
11+
idf_component_examples=$(find ./components/arduino-esp32/idf_component_examples -mindepth 1 -maxdepth 1 -type d)
12+
13+
for example in $idf_component_examples; do
14+
if [ -f "$example"/ci.json ]; then
15+
# If the target is listed as false, skip the sketch. Otherwise, include it.
16+
is_target=$(jq -r --arg target "$IDF_TARGET" '.targets[$target]' "$example"/ci.json)
17+
if [[ "$is_target" == "false" ]]; then
18+
printf "\n\033[93mSkipping %s for target %s\033[0m\n\n" "$example" "$IDF_TARGET"
19+
continue
20+
fi
21+
fi
22+
23+
idf.py -C "$example" set-target "$IDF_TARGET"
24+
25+
has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig")
26+
if [ "$has_requirements" -eq 0 ]; then
27+
printf "\n\033[93m%s does not meet the requirements for %s. Skipping...\033[0m\n\n" "$example" "$IDF_TARGET"
28+
continue
29+
fi
30+
31+
printf "\n\033[95mBuilding %s\033[0m\n\n" "$example"
32+
idf.py -C "$example" -DEXTRA_COMPONENT_DIRS="$PWD/components" build
33+
done

.github/scripts/on-release.sh

+14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ PACKAGE_JSON_MERGE="$GITHUB_WORKSPACE/.github/scripts/merge_packages.py"
3535
PACKAGE_JSON_TEMPLATE="$GITHUB_WORKSPACE/package/package_esp32_index.template.json"
3636
PACKAGE_JSON_DEV="package_esp32_dev_index.json"
3737
PACKAGE_JSON_REL="package_esp32_index.json"
38+
PACKAGE_JSON_DEV_CN="package_esp32_dev_index_cn.json"
39+
PACKAGE_JSON_REL_CN="package_esp32_index_cn.json"
3840

3941
echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
4042
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
@@ -339,9 +341,13 @@ jq_arg=".packages[0].platforms[0].version = \"$RELEASE_TAG\" | \
339341
# Generate package JSONs
340342
echo "Generating $PACKAGE_JSON_DEV ..."
341343
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
344+
# On MacOS the sed command won't skip the first match. Use gsed instead.
345+
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
342346
if [ "$RELEASE_PRE" == "false" ]; then
343347
echo "Generating $PACKAGE_JSON_REL ..."
344348
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_REL"
349+
# On MacOS the sed command won't skip the first match. Use gsed instead.
350+
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
345351
fi
346352

347353
# Figure out the last release or pre-release
@@ -373,12 +379,14 @@ echo
373379
if [ -n "$prev_any_release" ] && [ "$prev_any_release" != "null" ]; then
374380
echo "Merging with JSON from $prev_any_release ..."
375381
merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
382+
merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV_CN" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
376383
fi
377384

378385
if [ "$RELEASE_PRE" == "false" ]; then
379386
if [ -n "$prev_release" ] && [ "$prev_release" != "null" ]; then
380387
echo "Merging with JSON from $prev_release ..."
381388
merge_package_json "$prev_release/$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL"
389+
merge_package_json "$prev_release/$PACKAGE_JSON_REL_CN" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
382390
fi
383391
fi
384392

@@ -388,6 +396,8 @@ echo "Installing arduino-cli ..."
388396
export PATH="/home/runner/bin:$PATH"
389397
source "${SCRIPTS_DIR}/install-arduino-cli.sh"
390398

399+
# For the Chinese mirror, we can't test the package JSONs as the Chinese mirror might not be updated yet.
400+
391401
echo "Testing $PACKAGE_JSON_DEV install ..."
392402

393403
echo "Installing esp32 ..."
@@ -445,11 +455,15 @@ fi
445455
echo "Uploading $PACKAGE_JSON_DEV ..."
446456
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
447457
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
458+
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
459+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
448460
echo
449461
if [ "$RELEASE_PRE" == "false" ]; then
450462
echo "Uploading $PACKAGE_JSON_REL ..."
451463
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
452464
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
465+
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
466+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
453467
echo
454468
fi
455469

.github/scripts/sketch_utils.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function check_requirements { # check_requirements <sketchdir> <sdkconfig_path>
1616
local requirements_or
1717

1818
if [ ! -f "$sdkconfig_path" ] || [ ! -f "$sketchdir/ci.json" ]; then
19-
echo "ERROR: sdkconfig or ci.json not found" 1>&2
19+
echo "WARNING: sdkconfig or ci.json not found. Assuming requirements are met." 1>&2
2020
# Return 1 on error to force the sketch to be built and fail. This way the
2121
# CI will fail and the user will know that the sketch has a problem.
2222
else
@@ -244,7 +244,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
244244
build_dir="$ARDUINO_BUILD_DIR"
245245
elif [ "$len" -eq 1 ]; then
246246
# build_dir="$sketchdir/build"
247-
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
247+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
248248
fi
249249

250250
output_file="$HOME/.arduino/cli_compile_output.txt"
@@ -254,7 +254,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
254254
for i in $(seq 0 $((len - 1))); do
255255
if [ "$len" -ne 1 ]; then
256256
# build_dir="$sketchdir/build$i"
257-
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
257+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
258258
fi
259259
rm -rf "$build_dir"
260260
mkdir -p "$build_dir"

.github/scripts/tests_run.sh

+15-13
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ function run_test {
1111
local error=0
1212
local sdkconfig_path
1313
local extra_args
14+
local test_type
1415

1516
sketchdir=$(dirname "$sketch")
1617
sketchname=$(basename "$sketchdir")
18+
test_type=$(basename "$(dirname "$sketchdir")")
1719

1820
if [ "$options" -eq 0 ] && [ -f "$sketchdir"/ci.json ]; then
1921
len=$(jq -r --arg target "$target" '.fqbn[$target] | length' "$sketchdir"/ci.json)
@@ -25,9 +27,9 @@ function run_test {
2527
fi
2628

2729
if [ "$len" -eq 1 ]; then
28-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build.tmp/sdkconfig"
30+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build.tmp/sdkconfig"
2931
else
30-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build0.tmp/sdkconfig"
32+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build0.tmp/sdkconfig"
3133
fi
3234

3335
if [ -f "$sketchdir"/ci.json ]; then
@@ -43,22 +45,22 @@ function run_test {
4345
fi
4446

4547
if [ ! -f "$sdkconfig_path" ]; then
46-
printf "\033[93mSketch %s not built\nMight be due to missing target requirements or build failure\033[0m\n" "$sketchname"
48+
printf "\033[93mSketch %s build not found in %s\nMight be due to missing target requirements or build failure\033[0m\n" "$(dirname "$sdkconfig_path")" "$sketchname"
4749
printf "\n\n\n"
4850
return 0
4951
fi
5052

51-
local right_target
52-
right_target=$(grep -E "^CONFIG_IDF_TARGET=\"$target\"$" "$sdkconfig_path")
53-
if [ -z "$right_target" ]; then
54-
printf "\033[91mError: Sketch %s compiled for different target\n\033[0m\n" "$sketchname"
53+
local compiled_target
54+
compiled_target=$(grep -E "CONFIG_IDF_TARGET=" "$sdkconfig_path" | cut -d'"' -f2)
55+
if [ "$compiled_target" != "$target" ]; then
56+
printf "\033[91mError: Sketch %s compiled for %s, expected %s\033[0m\n" "$sketchname" "$compiled_target" "$target"
5557
printf "\n\n\n"
5658
return 1
5759
fi
5860

5961
if [ "$len" -eq 1 ]; then
6062
# build_dir="$sketchdir/build"
61-
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
63+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
6264
report_file="$sketchdir/$target/$sketchname.xml"
6365
fi
6466

@@ -81,7 +83,7 @@ function run_test {
8183

8284
if [ "$len" -ne 1 ]; then
8385
# build_dir="$sketchdir/build$i"
84-
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
86+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
8587
report_file="$sketchdir/$target/$sketchname$i.xml"
8688
fi
8789

@@ -113,14 +115,14 @@ function run_test {
113115
rm "$sketchdir"/diagram.json 2>/dev/null || true
114116

115117
result=0
116-
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "${extra_args[*]@Q}"
117-
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" ${extra_args[*]@Q}; exit \$?" || result=$?
118+
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
119+
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" -o junit_suite_name=${test_type}_${platform}_${target}_${sketchname}${i} ${extra_args[*]@Q}; exit \$?" || result=$?
118120
printf "\n"
119121
if [ $result -ne 0 ]; then
120122
result=0
121123
printf "\033[95mRetrying test: %s -- Config: %s\033[0m\n" "$sketchname" "$i"
122-
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "${extra_args[*]@Q}"
123-
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" ${extra_args[*]@Q}; exit \$?" || result=$?
124+
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
125+
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" -o junit_suite_name=${test_type}_${platform}_${target}_${sketchname}${i} ${extra_args[*]@Q}; exit \$?" || result=$?
124126
printf "\n"
125127
if [ $result -ne 0 ]; then
126128
printf "\033[91mFailed test: %s -- Config: %s\033[0m\n\n" "$sketchname" "$i"

.github/workflows/allboards.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1919
with:
2020
ref: ${{ github.event.client_payload.branch }}
2121

@@ -32,13 +32,13 @@ jobs:
3232

3333
steps:
3434
- name: Checkout repository
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636
with:
3737
ref: ${{ github.event.client_payload.branch }}
3838

3939
- run: npm install
4040
- name: Setup jq
41-
uses: dcarbone/install-jq-action@v1.0.1
41+
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
4242

4343
- id: set-test-chunks
4444
name: Set Chunks
@@ -64,7 +64,7 @@ jobs:
6464

6565
steps:
6666
- name: Checkout repository
67-
uses: actions/checkout@v4
67+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6868
with:
6969
ref: ${{ github.event.client_payload.branch }}
7070

@@ -74,7 +74,7 @@ jobs:
7474
FQBN: ${{ toJSON(matrix.chunk) }}
7575

7676
- name: Compile sketch
77-
uses: P-R-O-C-H-Y/compile-sketches@main
77+
uses: P-R-O-C-H-Y/compile-sketches@a62f069b92dc8f5053da4ac439ea6d1950cf6379 # main
7878
with:
7979
platforms: |
8080
${{ env.REPOSITORY }}

.github/workflows/boards.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
steps:
2323
# This step makes the contents of the repository available to the workflow
2424
- name: Checkout repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626

2727
- name: Setup jq
28-
uses: dcarbone/install-jq-action@v1.0.1
28+
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
2929

3030
- name: Get board name
3131
run: bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}
@@ -47,7 +47,7 @@ jobs:
4747
steps:
4848
# This step makes the contents of the repository available to the workflow
4949
- name: Checkout repository
50-
uses: actions/checkout@v4
50+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5151

5252
- name: Check if build.board is uppercase
5353
run: |
@@ -60,7 +60,7 @@ jobs:
6060
fi
6161
6262
- name: Get libs cache
63-
uses: actions/cache@v4
63+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6464
with:
6565
key: libs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package/package_esp32_index.template.json', 'tools/get.py') }}
6666
path: |
@@ -73,7 +73,7 @@ jobs:
7373
./tools/xtensa-*
7474
7575
- name: Compile sketch
76-
uses: P-R-O-C-H-Y/compile-sketches@main
76+
uses: P-R-O-C-H-Y/compile-sketches@a62f069b92dc8f5053da4ac439ea6d1950cf6379 # main
7777
with:
7878
platforms: |
7979
${{ env.REPOSITORY }}

0 commit comments

Comments
 (0)