Skip to content

Commit 03e3bed

Browse files
authored
Merge branch 'release/v3.0.x' into allow-higher-console-baud-rates
2 parents 87a5d73 + 5afbb38 commit 03e3bed

File tree

266 files changed

+8465
-1659
lines changed

Some content is hidden

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

266 files changed

+8465
-1659
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ body:
7575
attributes:
7676
label: IDE Name
7777
description: What IDE are you using?
78-
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
78+
placeholder: eg. Arduino IDE, VSCode, Sloeber...
7979
validations:
8080
required: true
8181
- type: input

.github/scripts/find_new_boards.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
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-
Boards_modified_url=$(curl -s $url | jq -r '.[] | select(.filename == "boards.txt") | .raw_url')
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-
# Echo the modified boards.txt file URL
14-
echo "Modified boards.txt file URL:"
15-
echo $Boards_modified_url
16-
17-
# Download the modified boards.txt file
18-
curl -L -o boards_pr.txt $Boards_modified_url
19-
20-
# Compare boards.txt file in the repo with the modified file
21-
diff=$(diff -u boards.txt boards_pr.txt)
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
2220

2321
# Extract added or modified lines (lines starting with '+' or '-')
2422
modified_lines=$(echo "$diff" | grep -E '^[+-][^+-]')
2523

24+
# Print the modified lines for debugging
25+
echo "Modified lines:"
26+
echo "$modified_lines"
27+
2628
boards_array=()
2729
previous_board=""
28-
file="boards.txt"
2930

3031
# Extract board names from the modified lines, and add them to the boards_array
3132
while read -r line

.github/scripts/install-platformio-esp32.sh

Lines changed: 7 additions & 86 deletions
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,64 +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 (AND)
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-
111-
# Check if the sketch requires any configuration options (OR)
112-
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
113-
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
114-
found=false
115-
for requirement in $requirements_or; do
116-
requirement=$(echo $requirement | xargs)
117-
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
118-
if [[ "$found_line" != "" ]]; then
119-
found=true
120-
break
121-
fi
122-
done
123-
if [[ "$found" == "false" ]]; then
124-
continue
125-
fi
126-
fi
127-
fi
128-
129-
echo $sketch >> sketches.txt
130-
sketchnum=$(($sketchnum + 1))
131-
done
132-
return $sketchnum
133-
}
134-
13580
function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-path> <chunk> <total-chunks>
13681
if [ "$#" -lt 3 ]; then
13782
echo "ERROR: Illegal number of parameters"
@@ -160,7 +105,7 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
160105
fi
161106

162107
set +e
163-
count_sketches "$examples"
108+
${COUNT_SKETCHES} "$examples" "esp32"
164109
local sketchcount=$?
165110
set -e
166111
local sketches=$(cat sketches.txt)
@@ -204,33 +149,9 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
204149
continue
205150
fi
206151

207-
# Check if the sketch requires any configuration options (AND)
208-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
209-
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
210-
for requirement in $requirements; do
211-
requirement=$(echo $requirement | xargs)
212-
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
213-
if [[ "$found_line" == "" ]]; then
214-
continue 2
215-
fi
216-
done
217-
fi
218-
219-
# Check if the sketch requires any configuration options (OR)
220-
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
221-
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
222-
found=false
223-
for requirement in $requirements_or; do
224-
requirement=$(echo $requirement | xargs)
225-
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
226-
if [[ "$found_line" != "" ]]; then
227-
found=true
228-
break
229-
fi
230-
done
231-
if [[ "$found" == "false" ]]; then
232-
continue
233-
fi
152+
local has_requirements=$(${CHECK_REQUIREMENTS} $sketchdir "$SDKCONFIG_DIR/esp32/sdkconfig")
153+
if [ "$has_requirements" == "0" ]; then
154+
continue
234155
fi
235156
fi
236157

.github/scripts/set_push_chunks.sh

Lines changed: 58 additions & 58 deletions
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)