Skip to content

Commit 3e5d570

Browse files
authored
Merge branch 'espressif:master' into sylque-patch-1
2 parents d73c520 + 98da424 commit 3e5d570

File tree

223 files changed

+9883
-907
lines changed

Some content is hidden

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

223 files changed

+9883
-907
lines changed

Diff for: .editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ indent_size = 2
1818
indent_style = space
1919

2020
[*.{bash,sh}]
21-
indent_size = 2
21+
indent_size = 4
2222
indent_style = space
2323

2424
[*.{c,cc,cp,cpp,cxx,h,hh,hpp,hxx,ii,inl,ino,ixx,pde,tpl,tpp,txx}]

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

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v3.0.6
45+
- v3.0.5
4446
- v3.0.4
4547
- v3.0.3
4648
- v3.0.2

Diff for: .github/scripts/find_new_boards.sh

+23-44
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,39 @@
22

33
# Get inputs from command
44
owner_repository=$1
5-
pr_number=$2
5+
base_ref=$2
66

7-
url="https://api.github.com/repos/$owner_repository/pulls/$pr_number/files"
8-
echo $url
7+
# Download the boards.txt file from the base branch
8+
curl -L -o boards_base.txt https://raw.githubusercontent.com/$owner_repository/$base_ref/boards.txt
99

10-
# Get changes in boards.txt file from PR
11-
Patch=$(curl $url | jq -r '.[] | select(.filename == "boards.txt") | .patch ')
10+
# Compare boards.txt file in the repo with the modified file from PR
11+
diff=$(diff -u boards_base.txt boards.txt)
1212

13-
# Extract only changed lines number and count
14-
substring_patch=$(echo "$Patch" | grep -o '@@[^@]*@@')
15-
16-
params_array=()
13+
# Check if the diff is empty
14+
if [ -z "$diff" ]
15+
then
16+
echo "No changes in boards.txt file"
17+
echo "FQBNS="
18+
exit 0
19+
fi
1720

18-
IFS=$'\n' read -d '' -ra params <<< $(echo "$substring_patch" | grep -oE '[-+][0-9]+,[0-9]+')
21+
# Extract added or modified lines (lines starting with '+' or '-')
22+
modified_lines=$(echo "$diff" | grep -E '^[+-][^+-]')
1923

20-
for param in "${params[@]}"
21-
do
22-
echo "The parameter is $param"
23-
params_array+=("$param")
24-
done
24+
# Print the modified lines for debugging
25+
echo "Modified lines:"
26+
echo "$modified_lines"
2527

2628
boards_array=()
2729
previous_board=""
28-
file="boards.txt"
2930

30-
# Loop through boards.txt file and extract all boards that were added
31-
for (( c=0; c<${#params_array[@]}; c+=2 ))
31+
# Extract board names from the modified lines, and add them to the boards_array
32+
while read -r line
3233
do
33-
deletion_count=$( echo "${params_array[c]}" | cut -d',' -f2 | cut -d' ' -f1 )
34-
addition_line=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f1 )
35-
addition_count=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f2 | cut -d' ' -f1 )
36-
addition_end=$(($addition_line+$addition_count))
37-
38-
addition_line=$(($addition_line + 3))
39-
addition_end=$(($addition_end - $deletion_count))
40-
41-
echo $addition_line
42-
echo $addition_end
43-
44-
i=0
45-
46-
while read -r line
47-
do
48-
i=$((i+1))
49-
if [ $i -lt $addition_line ]
50-
then
51-
continue
52-
elif [ $i -gt $addition_end ]
53-
then
54-
break
55-
fi
5634
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
57-
if [ "$board_name" != "" ] && [ "$board_name" != "esp32_family" ]
35+
# remove + or - from the board name at the beginning
36+
board_name=$(echo "$board_name" | sed 's/^[+-]//')
37+
if [ "$board_name" != "" ] && [ "$board_name" != "+" ] && [ "$board_name" != "-" ] && [ "$board_name" != "esp32_family" ]
5838
then
5939
if [ "$board_name" != "$previous_board" ]
6040
then
@@ -63,8 +43,7 @@ do
6343
echo "Added 'espressif:esp32:$board_name' to array"
6444
fi
6545
fi
66-
done < "$file"
67-
done
46+
done <<< "$modified_lines"
6847

6948
# Create JSON like string with all boards found and pass it to env variable
7049
board_count=${#boards_array[@]}

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

+7-52
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ TOOLCHAIN_VERSION="12.2.0+20230208"
77
ESPTOOLPY_VERSION="~1.40501.0"
88
ESPRESSIF_ORGANIZATION_NAME="espressif"
99
SDKCONFIG_DIR="$PLATFORMIO_ESP32_PATH/tools/esp32-arduino-libs"
10+
SCRIPTS_DIR="./.github/scripts"
11+
COUNT_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh count"
12+
CHECK_REQUIREMENTS="${SCRIPTS_DIR}/sketch_utils.sh check_requirements"
1013

1114
echo "Installing Python Wheel ..."
1215
pip install wheel > /dev/null 2>&1
@@ -74,47 +77,6 @@ function build_pio_sketch(){ # build_pio_sketch <board> <options> <path-to-ino>
7477
python -m platformio ci --board "$board" "$sketch_dir" --project-option="$options"
7578
}
7679

77-
function count_sketches(){ # count_sketches <examples-path>
78-
local examples="$1"
79-
rm -rf sketches.txt
80-
if [ ! -d "$examples" ]; then
81-
touch sketches.txt
82-
return 0
83-
fi
84-
local sketches=$(find $examples -name *.ino)
85-
local sketchnum=0
86-
for sketch in $sketches; do
87-
local sketchdir=$(dirname $sketch)
88-
local sketchdirname=$(basename $sketchdir)
89-
local sketchname=$(basename $sketch)
90-
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
91-
continue
92-
elif [ -f $sketchdir/ci.json ]; then
93-
# If the target is listed as false, skip the sketch. Otherwise, include it.
94-
is_target=$(jq -r '.targets[esp32]' $sketchdir/ci.json)
95-
if [[ "$is_target" == "false" ]]; then
96-
continue
97-
fi
98-
99-
# Check if the sketch requires any configuration options
100-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
101-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
102-
for requirement in $requirements; do
103-
requirement=$(echo $requirement | xargs)
104-
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
105-
if [[ "$found_line" == "" ]]; then
106-
continue 2
107-
fi
108-
done
109-
fi
110-
fi
111-
112-
echo $sketch >> sketches.txt
113-
sketchnum=$(($sketchnum + 1))
114-
done
115-
return $sketchnum
116-
}
117-
11880
function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-path> <chunk> <total-chunks>
11981
if [ "$#" -lt 3 ]; then
12082
echo "ERROR: Illegal number of parameters"
@@ -143,7 +105,7 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
143105
fi
144106

145107
set +e
146-
count_sketches "$examples"
108+
${COUNT_SKETCHES} "$examples" "esp32"
147109
local sketchcount=$?
148110
set -e
149111
local sketches=$(cat sketches.txt)
@@ -187,16 +149,9 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
187149
continue
188150
fi
189151

190-
# Check if the sketch requires any configuration options
191-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
192-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
193-
for requirement in $requirements; do
194-
requirement=$(echo $requirement | xargs)
195-
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
196-
if [[ "$found_line" == "" ]]; then
197-
continue 2
198-
fi
199-
done
152+
local has_requirements=$(${CHECK_REQUIREMENTS} $sketchdir "$SDKCONFIG_DIR/esp32/sdkconfig")
153+
if [ "$has_requirements" == "0" ]; then
154+
continue
200155
fi
201156
fi
202157

Diff for: .github/scripts/set_push_chunks.sh

+58-58
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,73 @@ build_all=false
44
chunks_count=0
55

66
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
7+
echo "Core files changed or not a PR. Building all."
8+
build_all=true
9+
chunks_count=$MAX_CHUNKS
1010
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
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+
lib=$(echo $file | awk -F "/" '{print $1"/"$2}')
31+
if [[ "$file" == *.ino ]]; then
32+
# If file ends with .ino, add it to the list of sketches
33+
echo "Sketch found: $file"
34+
sketches+="$file "
35+
elif [[ "$file" == "$lib/src/"* ]]; then
36+
# If file is inside the src directory, find all sketches in the lib/examples directory
37+
echo "Library src file found: $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
5252
fi
5353

5454
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"
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"
6464

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
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
6969
fi
7070

7171
chunks='["0"'
7272
for i in $(seq 1 $(( $chunks_count - 1 )) ); do
73-
chunks+=",\"$i\""
73+
chunks+=",\"$i\""
7474
done
7575
chunks+="]"
7676

0 commit comments

Comments
 (0)