Skip to content

Commit b80c2e1

Browse files
Merge branch 'master' into nb1
2 parents 9d8b43b + 32def87 commit b80c2e1

File tree

691 files changed

+15256
-3747
lines changed

Some content is hidden

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

691 files changed

+15256
-3747
lines changed

Diff for: .flake8

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python/.flake8
22
# See: https://flake8.pycqa.org/en/latest/user/configuration.html
3-
# The code style defined in this file is the official standardized style to be used in all Arduino tooling projects and
4-
# should not be modified.
53

64
[flake8]
75
doctests = True
86
# W503 and W504 are mutually exclusive. PEP 8 recommends line break before.
97
ignore = W503,E203
10-
max-complexity = 10
8+
max-complexity = 20
119
max-line-length = 120
1210
select = E,W,F,C,N

Diff for: .github/ISSUE_TEMPLATE/Issue-report.yml

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v3.0.1
45+
- v3.0.0
46+
- v2.0.17
47+
- v2.0.16
48+
- v2.0.15
4449
- v2.0.14
4550
- v2.0.13
4651
- v2.0.12

Diff for: .github/scripts/find_new_boards.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ do
5454
break
5555
fi
5656
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
57-
if [ "$board_name" != "" ]
57+
if [ "$board_name" != "" ] && [ "$board_name" != "esp32_family" ]
5858
then
5959
if [ "$board_name" != "$previous_board" ]
6060
then

Diff for: .github/scripts/install-platformio-esp32.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ function count_sketches(){ # count_sketches <examples-path>
8989
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
9090
continue
9191
fi
92-
if [[ -f "$sketchdir/.test.skip" ]]; then
92+
is_target=$(jq -r --arg target $target '.targets[$target]' $sketchdir/ci.json)
93+
# If the target is listed as false, skip the sketch. Otherwise, include it.
94+
if [[ "$is_target" == "false" ]]; then
9395
continue
9496
fi
9597
echo $sketch >> sketches.txt
@@ -161,8 +163,10 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
161163
local sketchdir=$(dirname $sketch)
162164
local sketchdirname=$(basename $sketchdir)
163165
local sketchname=$(basename $sketch)
166+
is_target=$(jq -r --arg target $target '.targets[$target]' $sketchdir/ci.json)
167+
# If the target is listed as false, skip the sketch. Otherwise, include it.
164168
if [ "${sketchdirname}.ino" != "$sketchname" ] \
165-
|| [ -f "$sketchdir/.test.skip" ]; then
169+
|| [[ "$is_target" == "false" ]]; then
166170
continue
167171
fi
168172
sketchnum=$(($sketchnum + 1))

Diff for: .github/scripts/merge_packages.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# Written by Ivan Grokhotkov, 2015
66
#
77
from __future__ import print_function
8-
from distutils.version import LooseVersion
8+
#from distutils.version import LooseVersion
9+
from packaging.version import Version
910
import re
1011
import json
1112
import sys
@@ -33,7 +34,7 @@ def merge_objects(versions, obj):
3334
def pkgVersionNormalized(versionString):
3435

3536
verStr = str(versionString)
36-
verParts = re.split('\.|-rc', verStr, flags=re.IGNORECASE)
37+
verParts = re.split('\.|-rc|-alpha', verStr, flags=re.IGNORECASE)
3738

3839
if len(verParts) == 3:
3940
if (sys.version_info > (3, 0)): # Python 3
@@ -74,7 +75,8 @@ def main(args):
7475
print("Adding platform {0}-{1}".format(name, version), file=sys.stderr)
7576
pkg1['platforms'].append(platforms[name][version])
7677

77-
pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True)
78+
#pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True)
79+
pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: Version(pkgVersionNormalized(k['version'])), reverse=True)
7880

7981
json.dump({'packages':[pkg1]}, sys.stdout, indent=2)
8082

Diff for: .github/scripts/on-push.sh

+14-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ function build(){
1010
local chunk_index=$3
1111
local chunks_cnt=$4
1212
local build_log=$5
13-
shift; shift; shift; shift; shift;
13+
local sketches_file=$6
14+
shift; shift; shift; shift; shift; shift;
1415
local sketches=$*
1516

1617
local BUILD_SKETCH="${SCRIPTS_DIR}/sketch_utils.sh build"
@@ -23,6 +24,9 @@ function build(){
2324
if [ "$OS_IS_LINUX" == "1" ]; then
2425
args+=" -p $ARDUINO_ESP32_PATH/libraries"
2526
args+=" -i $chunk_index -m $chunks_cnt"
27+
if [ -n "$sketches_file" ]; then
28+
args+=" -f $sketches_file"
29+
fi
2630
if [ $build_log -eq 1 ]; then
2731
args+=" -l $build_log"
2832
fi
@@ -50,6 +54,7 @@ fi
5054
CHUNK_INDEX=$1
5155
CHUNKS_CNT=$2
5256
BUILD_LOG=$3
57+
SKETCHES_FILE=$4
5358
BUILD_PIO=0
5459
if [ "$#" -lt 2 ] || [ "$CHUNKS_CNT" -le 0 ]; then
5560
CHUNK_INDEX=0
@@ -60,7 +65,7 @@ elif [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
6065
BUILD_PIO=1
6166
fi
6267

63-
if [ "$BUILD_LOG" -le 0 ]; then
68+
if [ -z "$BUILD_LOG" ] || [ "$BUILD_LOG" -le 0 ]; then
6469
BUILD_LOG=0
6570
fi
6671

@@ -69,7 +74,6 @@ fi
6974

7075
SCRIPTS_DIR="./.github/scripts"
7176
if [ "$BUILD_PIO" -eq 0 ]; then
72-
#source ${SCRIPTS_DIR}/install-arduino-ide.sh
7377
source ${SCRIPTS_DIR}/install-arduino-cli.sh
7478
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
7579

@@ -95,16 +99,16 @@ if [ "$BUILD_PIO" -eq 0 ]; then
9599
fi
96100

97101
#build sketches for different targets
98-
build "esp32s3" $FQBN_ESP32S3 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
99-
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
100-
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
101-
build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
102-
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
103-
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $BUILD_LOG $SKETCHES_ESP32
102+
build "esp32s3" $FQBN_ESP32S3 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
103+
build "esp32s2" $FQBN_ESP32S2 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
104+
build "esp32c3" $FQBN_ESP32C3 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
105+
build "esp32c6" $FQBN_ESP32C6 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
106+
build "esp32h2" $FQBN_ESP32H2 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
107+
build "esp32" $FQBN_ESP32 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
104108

105109
if [ "$BUILD_LOG" -eq 1 ]; then
106110
#remove last comma from the last JSON object
107-
sed -i '$ s/.$//' "$sizes_file"
111+
sed -i '$ s/,$//' "$sizes_file"
108112
#echo end of JSON array
109113
echo "]}" >> $sizes_file
110114
fi

Diff for: .github/scripts/on-release.sh

+23-4
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,23 @@ find "$PKG_DIR" -name '*.git*' -type f -delete
216216
##
217217
RVTC_NAME="riscv32-esp-elf-gcc"
218218
RVTC_NEW_NAME="esp-rv32"
219+
X32TC_NAME="xtensa-esp32-elf-gcc"
220+
X32TC_NEW_NAME="esp-x32"
221+
XS2TC_NAME="xtensa-esp32s2-elf-gcc"
222+
XS2TC_NEW_NAME="esp-xs2"
223+
XS3TC_NAME="xtensa-esp32s3-elf-gcc"
224+
XS3TC_NEW_NAME="esp-xs3"
219225

220226
# Replace tools locations in platform.txt
221227
echo "Generating platform.txt..."
222228
cat "$GITHUB_WORKSPACE/platform.txt" | \
223229
sed "s/version=.*/version=$RELEASE_TAG/g" | \
230+
sed 's/tools\.esp32-arduino-libs\.path\.windows=.*//g' | \
224231
sed 's/{runtime\.platform\.path}.tools.esp32-arduino-libs/\{runtime.tools.esp32-arduino-libs.path\}/g' | \
225232
sed 's/{runtime\.platform\.path}.tools.xtensa-esp-elf-gdb/\{runtime.tools.xtensa-esp-elf-gdb.path\}/g' | \
226-
sed 's/{runtime\.platform\.path}.tools.xtensa-esp32-elf/\{runtime.tools.xtensa-esp32-elf-gcc.path\}/g' | \
227-
sed 's/{runtime\.platform\.path}.tools.xtensa-esp32s2-elf/\{runtime.tools.xtensa-esp32s2-elf-gcc.path\}/g' | \
228-
sed 's/{runtime\.platform\.path}.tools.xtensa-esp32s3-elf/\{runtime.tools.xtensa-esp32s3-elf-gcc.path\}/g' | \
233+
sed "s/{runtime\.platform\.path}.tools.xtensa-esp32-elf/\\{runtime.tools.$X32TC_NEW_NAME.path\\}/g" | \
234+
sed "s/{runtime\.platform\.path}.tools.xtensa-esp32s2-elf/\\{runtime.tools.$XS2TC_NEW_NAME.path\\}/g" | \
235+
sed "s/{runtime\.platform\.path}.tools.xtensa-esp32s3-elf/\\{runtime.tools.$XS3TC_NEW_NAME.path\\}/g" | \
229236
sed 's/{runtime\.platform\.path}.tools.riscv32-esp-elf-gdb/\{runtime.tools.riscv32-esp-elf-gdb.path\}/g' | \
230237
sed "s/{runtime\.platform\.path}.tools.riscv32-esp-elf/\\{runtime.tools.$RVTC_NEW_NAME.path\\}/g" | \
231238
sed 's/{runtime\.platform\.path}.tools.esptool/\{runtime.tools.esptool_py.path\}/g' | \
@@ -341,7 +348,19 @@ rvtc_jq_arg="\
341348
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$RVTC_NAME\")).version = \"$RVTC_VERSION\" |\
342349
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$RVTC_NAME\")).name = \"$RVTC_NEW_NAME\" |\
343350
(.packages[0].tools[] | select(.name==\"$RVTC_NAME\")).version = \"$RVTC_VERSION\" |\
344-
(.packages[0].tools[] | select(.name==\"$RVTC_NAME\")).name = \"$RVTC_NEW_NAME\""
351+
(.packages[0].tools[] | select(.name==\"$RVTC_NAME\")).name = \"$RVTC_NEW_NAME\" |\
352+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$X32TC_NAME\")).version = \"$RVTC_VERSION\" |\
353+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$X32TC_NAME\")).name = \"$X32TC_NEW_NAME\" |\
354+
(.packages[0].tools[] | select(.name==\"$X32TC_NAME\")).version = \"$RVTC_VERSION\" |\
355+
(.packages[0].tools[] | select(.name==\"$X32TC_NAME\")).name = \"$X32TC_NEW_NAME\" |\
356+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$XS2TC_NAME\")).version = \"$RVTC_VERSION\" |\
357+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$XS2TC_NAME\")).name = \"$XS2TC_NEW_NAME\" |\
358+
(.packages[0].tools[] | select(.name==\"$XS2TC_NAME\")).version = \"$RVTC_VERSION\" |\
359+
(.packages[0].tools[] | select(.name==\"$XS2TC_NAME\")).name = \"$XS2TC_NEW_NAME\" |\
360+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$XS3TC_NAME\")).version = \"$RVTC_VERSION\" |\
361+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$XS3TC_NAME\")).name = \"$XS3TC_NEW_NAME\" |\
362+
(.packages[0].tools[] | select(.name==\"$XS3TC_NAME\")).version = \"$RVTC_VERSION\" |\
363+
(.packages[0].tools[] | select(.name==\"$XS3TC_NAME\")).name = \"$XS3TC_NEW_NAME\""
345364
cat "$PACKAGE_JSON_TEMPLATE" | jq "$rvtc_jq_arg" > "$OUTPUT_DIR/package-$LIBS_PROJ_NAME-rvfix.json"
346365
PACKAGE_JSON_TEMPLATE="$OUTPUT_DIR/package-$LIBS_PROJ_NAME-rvfix.json"
347366

Diff for: .github/scripts/set_push_chunks.sh

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
3+
build_all=false
4+
chunks_count=0
5+
6+
if [[ $CORE_CHANGED == 'true' ]] || [[ $IS_PR != 'true' ]]; then
7+
echo "Core files changed or not a PR. Building all."
8+
build_all=true
9+
chunks_count=$MAX_CHUNKS
10+
elif [[ $LIB_CHANGED == 'true' ]]; then
11+
echo "Libraries changed. Building only affected sketches."
12+
if [[ $NETWORKING_CHANGED == 'true' ]]; then
13+
echo "Networking libraries changed. Building networking related sketches."
14+
networking_sketches="$(find libraries/WiFi -name *.ino) "
15+
networking_sketches+="$(find libraries/Ethernet -name *.ino) "
16+
networking_sketches+="$(find libraries/PPP -name *.ino) "
17+
networking_sketches+="$(find libraries/NetworkClientSecure -name *.ino) "
18+
networking_sketches+="$(find libraries/WebServer -name *.ino) "
19+
fi
20+
if [[ $FS_CHANGED == 'true' ]]; then
21+
echo "FS libraries changed. Building FS related sketches."
22+
fs_sketches="$(find libraries/SD -name *.ino) "
23+
fs_sketches+="$(find libraries/SD_MMC -name *.ino) "
24+
fs_sketches+="$(find libraries/SPIFFS -name *.ino) "
25+
fs_sketches+="$(find libraries/LittleFS -name *.ino) "
26+
fs_sketches+="$(find libraries/FFat -name *.ino) "
27+
fi
28+
sketches="$networking_sketches $fs_sketches"
29+
for file in $LIB_FILES; do
30+
if [[ $file == *.ino ]]; then
31+
# If file ends with .ino, add it to the list of sketches
32+
echo "Sketch found: $file"
33+
sketches+="$file "
34+
elif [[ $(basename $(dirname $file)) == "src" ]]; then
35+
# If file is in a src directory, find all sketches in the parent/examples directory
36+
echo "Library src file found: $file"
37+
lib=$(dirname $(dirname $file))
38+
if [[ -d $lib/examples ]]; then
39+
lib_sketches=$(find $lib/examples -name *.ino)
40+
sketches+="$lib_sketches "
41+
echo "Library sketches: $lib_sketches"
42+
fi
43+
else
44+
# If file is in a example folder but it is not a sketch, find all sketches in the current directory
45+
echo "File in example folder found: $file"
46+
sketch=$(find $(dirname $file) -name *.ino)
47+
sketches+="$sketch "
48+
echo "Sketch in example folder: $sketch"
49+
fi
50+
echo ""
51+
done
52+
fi
53+
54+
if [[ -n $sketches ]]; then
55+
# Remove duplicates
56+
sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
57+
for sketch in $sketches; do
58+
echo $sketch >> sketches_found.txt
59+
chunks_count=$((chunks_count+1))
60+
done
61+
echo "Number of sketches found: $chunks_count"
62+
echo "Sketches:"
63+
echo "$sketches"
64+
65+
if [[ $chunks_count -gt $MAX_CHUNKS ]]; then
66+
echo "More sketches than the allowed number of chunks found. Limiting to $MAX_CHUNKS chunks."
67+
chunks_count=$MAX_CHUNKS
68+
fi
69+
fi
70+
71+
chunks='["0"'
72+
for i in $(seq 1 $(( $chunks_count - 1 )) ); do
73+
chunks+=",\"$i\""
74+
done
75+
chunks+="]"
76+
77+
echo "build_all=$build_all" >> $GITHUB_OUTPUT
78+
echo "build_libraries=$BUILD_LIBRARIES" >> $GITHUB_OUTPUT
79+
echo "build_static_sketches=$BUILD_STATIC_SKETCHES" >> $GITHUB_OUTPUT
80+
echo "build_idf=$BUILD_IDF" >> $GITHUB_OUTPUT
81+
echo "build_platformio=$BUILD_PLATFORMIO" >> $GITHUB_OUTPUT
82+
echo "chunk_count=$chunks_count" >> $GITHUB_OUTPUT
83+
echo "chunks=$chunks" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)