Skip to content

Commit 0eb6f2b

Browse files
authored
Merge branch 'master' into PR_IPv6_final
2 parents e65751b + 1c3039e commit 0eb6f2b

File tree

176 files changed

+7444
-1490
lines changed

Some content is hidden

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

176 files changed

+7444
-1490
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v2.0.9
45+
- v2.0.8
46+
- v2.0.7
4447
- v2.0.6
4548
- v2.0.5
4649
- v2.0.4

.github/scripts/find_all_boards.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Get all boards
4+
boards_array=()
5+
6+
for line in `grep '.tarch=' boards.txt`; do
7+
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
8+
boards_array+=("espressif:esp32:$board_name")
9+
echo "Added 'espressif:esp32:$board_name' to array"
10+
done
11+
12+
# Create JSON like string with all boards found and pass it to env variable
13+
board_count=${#boards_array[@]}
14+
echo "Boards found: $board_count"
15+
echo "BOARD-COUNT=$board_count" >> $GITHUB_ENV
16+
17+
if [ $board_count -gt 0 ]
18+
then
19+
json_matrix='['
20+
for board in ${boards_array[@]}
21+
do
22+
json_matrix+='"'$board'"'
23+
if [ $board_count -gt 1 ]
24+
then
25+
json_matrix+=","
26+
fi
27+
board_count=$(($board_count - 1))
28+
done
29+
json_matrix+=']'
30+
31+
echo $json_matrix
32+
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
33+
else
34+
echo "FQBNS=" >> $GITHUB_ENV
35+
fi

.github/scripts/find_new_boards.sh

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/bin/bash
2+
3+
# Get inputs from command
4+
owner_repository=$1
5+
pr_number=$2
6+
7+
url="https://api.github.com/repos/$owner_repository/pulls/$pr_number/files"
8+
echo $url
9+
10+
# Get changes in boards.txt file from PR
11+
Patch=$(curl $url | jq -r '.[] | select(.filename == "boards.txt") | .patch ')
12+
13+
# Extract only changed lines number and count
14+
substring_patch=$(echo "$Patch" | grep -o '@@[^@]*@@')
15+
16+
params_array=()
17+
18+
IFS=$'\n' read -d '' -ra params <<< $(echo "$substring_patch" | grep -oE '[-+][0-9]+,[0-9]+')
19+
20+
for param in "${params[@]}"
21+
do
22+
echo "The parameter is $param"
23+
params_array+=("$param")
24+
done
25+
26+
boards_array=()
27+
previous_board=""
28+
file="boards.txt"
29+
30+
# Loop through boards.txt file and extract all boards that were added
31+
for (( c=0; c<${#params_array[@]}; c+=2 ))
32+
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
56+
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
57+
if [ "$board_name" != "" ]
58+
then
59+
if [ "$board_name" != "$previous_board" ]
60+
then
61+
boards_array+=("espressif:esp32:$board_name")
62+
previous_board="$board_name"
63+
echo "Added 'espressif:esp32:$board_name' to array"
64+
fi
65+
fi
66+
done < "$file"
67+
done
68+
69+
# Create JSON like string with all boards found and pass it to env variable
70+
board_count=${#boards_array[@]}
71+
72+
if [ $board_count -gt 0 ]
73+
then
74+
json_matrix='{"fqbn": ['
75+
for board in ${boards_array[@]}
76+
do
77+
json_matrix+='"'$board'"'
78+
if [ $board_count -gt 1 ]
79+
then
80+
json_matrix+=","
81+
fi
82+
board_count=$(($board_count - 1))
83+
done
84+
json_matrix+=']}'
85+
86+
echo $json_matrix
87+
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
88+
else
89+
echo "FQBNS=" >> $GITHUB_ENV
90+
fi
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
OSBITS=`arch`
4+
if [[ "$OSTYPE" == "linux"* ]]; then
5+
export OS_IS_LINUX="1"
6+
if [[ "$OSBITS" == "i686" ]]; then
7+
OS_NAME="linux32"
8+
elif [[ "$OSBITS" == "x86_64" ]]; then
9+
OS_NAME="linux64"
10+
elif [[ "$OSBITS" == "armv7l" || "$OSBITS" == "aarch64" ]]; then
11+
OS_NAME="linuxarm"
12+
else
13+
OS_NAME="$OSTYPE-$OSBITS"
14+
echo "Unknown OS '$OS_NAME'"
15+
exit 1
16+
fi
17+
elif [[ "$OSTYPE" == "darwin"* ]]; then
18+
export OS_IS_MACOS="1"
19+
OS_NAME="macosx"
20+
elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
21+
export OS_IS_WINDOWS="1"
22+
OS_NAME="windows"
23+
else
24+
OS_NAME="$OSTYPE-$OSBITS"
25+
echo "Unknown OS '$OS_NAME'"
26+
exit 1
27+
fi
28+
export OS_NAME
29+
30+
if [ "$OS_IS_MACOS" == "1" ]; then
31+
export ARDUINO_IDE_PATH="$HOME/bin"
32+
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
33+
elif [ "$OS_IS_WINDOWS" == "1" ]; then
34+
export ARDUINO_IDE_PATH="$HOME/bin"
35+
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
36+
else
37+
export ARDUINO_IDE_PATH="$HOME/bin"
38+
export ARDUINO_USR_PATH="$HOME/Arduino"
39+
fi
40+
41+
if [ ! -d "$ARDUINO_IDE_PATH" ] || [ ! -f "$ARDUINO_IDE_PATH/arduino-cli" ]; then
42+
echo "Installing Arduino CLI on $OS_NAME ..."
43+
mkdir -p "$ARDUINO_IDE_PATH"
44+
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$ARDUINO_IDE_PATH" sh
45+
fi
46+

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32"
44
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
55

6-
TOOLCHAIN_VERSION="8.4.0+2021r2-patch3"
7-
ESPTOOLPY_VERSION="~1.40201.0"
6+
TOOLCHAIN_VERSION="8.4.0+2021r2-patch5"
7+
ESPTOOLPY_VERSION="~1.40400.0"
88
ESPRESSIF_ORGANIZATION_NAME="espressif"
99

1010
echo "Installing Python Wheel ..."

.github/scripts/on-push.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ function build(){
99
local fqbn=$2
1010
local chunk_index=$3
1111
local chunks_cnt=$4
12-
local sketches=$5
12+
shift; shift; shift; shift;
13+
local sketches=$*
1314

1415
local BUILD_SKETCH="${SCRIPTS_DIR}/sketch_utils.sh build"
1516
local BUILD_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh chunk_build"
@@ -24,15 +25,15 @@ function build(){
2425
${BUILD_SKETCHES} ${args}
2526
else
2627
for sketch in ${sketches}; do
27-
args+=" -s $(dirname $sketch)"
28-
if [ "$OS_IS_WINDOWS" == "1" ]; then
28+
local sargs="$args -s $(dirname $sketch)"
29+
if [ "$OS_IS_WINDOWS" == "1" ] && [ -d "$ARDUINO_IDE_PATH/tools-builder" ]; then
2930
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
3031
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
3132
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version
3233
-prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
33-
args+=" ${win_opts}"
34+
sargs+=" ${win_opts}"
3435
fi
35-
${BUILD_SKETCH} ${args}
36+
${BUILD_SKETCH} ${sargs}
3637
done
3738
fi
3839
}
@@ -59,7 +60,8 @@ fi
5960

6061
SCRIPTS_DIR="./.github/scripts"
6162
if [ "$BUILD_PIO" -eq 0 ]; then
62-
source ${SCRIPTS_DIR}/install-arduino-ide.sh
63+
#source ${SCRIPTS_DIR}/install-arduino-ide.sh
64+
source ${SCRIPTS_DIR}/install-arduino-cli.sh
6365
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
6466

6567
FQBN_ESP32="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"

.github/scripts/on-release.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ find "$PKG_DIR" -name '*.git*' -type f -delete
197197
echo "Generating platform.txt..."
198198
cat "$GITHUB_WORKSPACE/platform.txt" | \
199199
sed "s/version=.*/version=$ver$extent/g" | \
200-
sed 's/runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf//g' | \
201-
sed 's/runtime.tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s2-elf//g' | \
202-
sed 's/runtime.tools.xtensa-esp32s3-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s3-elf//g' | \
203-
sed 's/runtime.tools.riscv32-esp-elf-gcc.path={runtime.platform.path}\/tools\/riscv32-esp-elf//g' | \
200+
sed 's/tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf/tools.xtensa-esp32-elf-gcc.path=\{runtime.tools.xtensa-esp32-elf-gcc.path\}/g' | \
201+
sed 's/tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s2-elf/tools.xtensa-esp32s2-elf-gcc.path=\{runtime.tools.xtensa-esp32s2-elf-gcc.path\}/g' | \
202+
sed 's/tools.xtensa-esp32s3-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s3-elf/tools.xtensa-esp32s3-elf-gcc.path=\{runtime.tools.xtensa-esp32s3-elf-gcc.path\}/g' | \
203+
sed 's/tools.riscv32-esp-elf-gcc.path={runtime.platform.path}\/tools\/riscv32-esp-elf/tools.riscv32-esp-elf-gcc.path=\{runtime.tools.riscv32-esp-elf-gcc.path\}/g' | \
204204
sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' | \
205205
sed 's/debug.server.openocd.path={runtime.platform.path}\/tools\/openocd-esp32\/bin\/openocd/debug.server.openocd.path=\{runtime.tools.openocd-esp32.path\}\/bin\/openocd/g' | \
206206
sed 's/debug.server.openocd.scripts_dir={runtime.platform.path}\/tools\/openocd-esp32\/share\/openocd\/scripts\//debug.server.openocd.scripts_dir=\{runtime.tools.openocd-esp32.path\}\/share\/openocd\/scripts\//g' | \

.github/scripts/sketch_utils.sh

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,38 +117,71 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
117117
# 3. Created at the sketch level as "buildX" where X is the number
118118
# of configuration built in case of a multiconfiguration test.
119119

120+
sketchname=$(basename $sketchdir)
121+
120122
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
121123
if [ -n "$ARDUINO_BUILD_DIR" ]; then
122124
build_dir="$ARDUINO_BUILD_DIR"
123125
elif [ $len -eq 1 ]; then
124-
build_dir="$sketchdir/build"
126+
# build_dir="$sketchdir/build"
127+
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
125128
fi
126129

127130
mkdir -p "$ARDUINO_CACHE_DIR"
128131
for i in `seq 0 $(($len - 1))`
129132
do
130133
if [ $len -ne 1 ]; then
131-
build_dir="$sketchdir/build$i"
134+
# build_dir="$sketchdir/build$i"
135+
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
132136
fi
133137
rm -rf $build_dir
134138
mkdir -p $build_dir
135139

136140
currfqbn=`echo $fqbn | jq -r --argjson i $i '.[$i]'`
137-
sketchname=$(basename $sketchdir)
138-
echo "Building $sketchname with FQBN=$currfqbn"
139-
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
140-
-fqbn=\"$currfqbn\" \
141-
-warnings="all" \
142-
-tools "$ide_path/tools-builder" \
143-
-tools "$ide_path/tools" \
144-
-built-in-libraries "$ide_path/libraries" \
145-
-hardware "$ide_path/hardware" \
146-
-hardware "$user_path/hardware" \
147-
-libraries "$user_path/libraries" \
148-
-build-cache "$ARDUINO_CACHE_DIR" \
149-
-build-path "$build_dir" \
150-
$xtra_opts "${sketchdir}/${sketchname}.ino"
141+
142+
if [ -f "$ide_path/arduino-cli" ]; then
143+
echo "Building $sketchname with arduino-cli and FQBN=$currfqbn"
144+
145+
curroptions=`echo "$currfqbn" | cut -d':' -f4`
146+
currfqbn=`echo "$currfqbn" | cut -d':' -f1-3`
147+
$ide_path/arduino-cli compile \
148+
--fqbn "$currfqbn" \
149+
--board-options "$curroptions" \
150+
--warnings "all" \
151+
--build-cache-path "$ARDUINO_CACHE_DIR" \
152+
--build-path "$build_dir" \
153+
$xtra_opts "${sketchdir}"
154+
elif [ -f "$ide_path/arduino-builder" ]; then
155+
echo "Building $sketchname with arduino-builder and FQBN=$currfqbn"
156+
echo "Build path = $build_dir"
157+
158+
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
159+
-fqbn=\"$currfqbn\" \
160+
-warnings="all" \
161+
-tools "$ide_path/tools-builder" \
162+
-hardware "$user_path/hardware" \
163+
-libraries "$user_path/libraries" \
164+
-build-cache "$ARDUINO_CACHE_DIR" \
165+
-build-path "$build_dir" \
166+
$xtra_opts "${sketchdir}/${sketchname}.ino"
167+
168+
# $ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
169+
# -fqbn=\"$currfqbn\" \
170+
# -warnings="all" \
171+
# -tools "$ide_path/tools-builder" \
172+
# -tools "$ide_path/tools" \
173+
# -built-in-libraries "$ide_path/libraries" \
174+
# -hardware "$ide_path/hardware" \
175+
# -hardware "$user_path/hardware" \
176+
# -libraries "$user_path/libraries" \
177+
# -build-cache "$ARDUINO_CACHE_DIR" \
178+
# -build-path "$build_dir" \
179+
# $xtra_opts "${sketchdir}/${sketchname}.ino"
180+
fi
151181
done
182+
unset fqbn
183+
unset xtra_opts
184+
unset options
152185
}
153186

154187
function count_sketches(){ # count_sketches <path> [target]
@@ -294,8 +327,7 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
294327
fi
295328
echo ""
296329
echo "Building Sketch Index $(($sketchnum - 1)) - $sketchdirname"
297-
args+=" -s $sketchdir $xtra_opts"
298-
build_sketch $args
330+
build_sketch $args -s $sketchdir $xtra_opts
299331
local result=$?
300332
if [ $result -ne 0 ]; then
301333
return $result

.github/scripts/tests_run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function run_test() {
1515
fi
1616

1717
if [ $len -eq 1 ]; then
18-
build_dir="tests/$sketchname/build"
18+
# build_dir="tests/$sketchname/build"
19+
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
1920
report_file="tests/$sketchname/$sketchname.xml"
2021
fi
2122

@@ -27,7 +28,8 @@ function run_test() {
2728
fi
2829

2930
if [ $len -ne 1 ]; then
30-
build_dir="tests/$sketchname/build$i"
31+
# build_dir="tests/$sketchname/build$i"
32+
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
3133
report_file="tests/$sketchname/$sketchname$i.xml"
3234
fi
3335

0 commit comments

Comments
 (0)