Skip to content

Commit 0f17f7d

Browse files
committed
Merge commit '44da992b' (tagged version 2.0.14) into S3-autobaud
2 parents 302f676 + 44da992 commit 0f17f7d

File tree

2,397 files changed

+69347
-47863
lines changed

Some content is hidden

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

2,397 files changed

+69347
-47863
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v2.0.13
45+
- v2.0.12
46+
- v2.0.11
47+
- v2.0.10
48+
- v2.0.9
49+
- v2.0.8
50+
- v2.0.7
4451
- v2.0.6
4552
- v2.0.5
4653
- 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: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPA
3636
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
3737
echo "Tag: $RELEASE_TAG, Draft: $draft, Pre-Release: $RELEASE_PRE"
3838

39+
# Try extracting something like a JSON with a "boards" array/element and "vendor" fields
40+
BOARDS=`echo $RELEASE_BODY | grep -Pzo '(?s){.*}' | jq -r '.boards[]? // .boards? // empty' | xargs echo -n 2>/dev/null`
41+
VENDOR=`echo $RELEASE_BODY | grep -Pzo '(?s){.*}' | jq -r '.vendor? // empty' | xargs echo -n 2>/dev/null`
42+
if ! [ -z "${BOARDS}" ]; then echo "Releasing board(s): $BOARDS" ; fi
43+
if ! [ -z "${VENDOR}" ]; then echo "Setting packager: $VENDOR" ; fi
44+
3945
function get_file_size(){
4046
local file="$1"
4147
if [[ "$OSTYPE" == "darwin"* ]]; then
@@ -171,12 +177,26 @@ mkdir -p "$PKG_DIR/tools"
171177

172178
# Copy all core files to the package folder
173179
echo "Copying files for packaging ..."
174-
cp -f "$GITHUB_WORKSPACE/boards.txt" "$PKG_DIR/"
180+
if [ -z "${BOARDS}" ]; then
181+
# Copy all variants
182+
cp -f "$GITHUB_WORKSPACE/boards.txt" "$PKG_DIR/"
183+
cp -Rf "$GITHUB_WORKSPACE/variants" "$PKG_DIR/"
184+
else
185+
# Remove all entries not starting with any board code or "menu." from boards.txt
186+
cat "$GITHUB_WORKSPACE/boards.txt" | grep "^menu\." > "$PKG_DIR/boards.txt"
187+
for board in ${BOARDS} ; do
188+
cat "$GITHUB_WORKSPACE/boards.txt" | grep "^${board}\." >> "$PKG_DIR/boards.txt"
189+
done
190+
# Copy only relevant variant files
191+
mkdir "$PKG_DIR/variants/"
192+
for variant in `cat ${PKG_DIR}/boards.txt | grep "\.variant=" | cut -d= -f2` ; do
193+
cp -Rf "$GITHUB_WORKSPACE/variants/${variant}" "$PKG_DIR/variants/"
194+
done
195+
fi
175196
cp -f "$GITHUB_WORKSPACE/package.json" "$PKG_DIR/"
176197
cp -f "$GITHUB_WORKSPACE/programmers.txt" "$PKG_DIR/"
177198
cp -Rf "$GITHUB_WORKSPACE/cores" "$PKG_DIR/"
178199
cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/"
179-
cp -Rf "$GITHUB_WORKSPACE/variants" "$PKG_DIR/"
180200
cp -f "$GITHUB_WORKSPACE/tools/espota.exe" "$PKG_DIR/tools/"
181201
cp -f "$GITHUB_WORKSPACE/tools/espota.py" "$PKG_DIR/tools/"
182202
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.py" "$PKG_DIR/tools/"
@@ -196,17 +216,24 @@ find "$PKG_DIR" -name '*.git*' -type f -delete
196216
# Replace tools locations in platform.txt
197217
echo "Generating platform.txt..."
198218
cat "$GITHUB_WORKSPACE/platform.txt" | \
199-
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' | \
219+
sed "s/version=.*/version=$RELEASE_TAG/g" | \
220+
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' | \
221+
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' | \
222+
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' | \
223+
sed 's/tools.xtensa-esp-elf-gdb.path={runtime.platform.path}\/tools\/xtensa-esp-elf-gdb/tools.xtensa-esp-elf-gdb.path=\{runtime.tools.xtensa-esp-elf-gdb.path\}/g' | \
224+
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' | \
225+
sed 's/tools.riscv32-esp-elf-gdb.path={runtime.platform.path}\/tools\/riscv32-esp-elf-gdb/tools.riscv32-esp-elf-gdb.path=\{runtime.tools.riscv32-esp-elf-gdb.path\}/g' | \
204226
sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' | \
205227
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' | \
206228
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' | \
207229
sed 's/debug.server.openocd.scripts_dir.windows={runtime.platform.path}\\tools\\openocd-esp32\\share\\openocd\\scripts\\/debug.server.openocd.scripts_dir.windows=\{runtime.tools.openocd-esp32.path\}\\share\\openocd\\scripts\\/g' \
208230
> "$PKG_DIR/platform.txt"
209231

232+
if ! [ -z ${VENDOR} ]; then
233+
# Append vendor name to platform.txt to create a separate section
234+
sed -i "/^name=.*/s/$/ ($VENDOR)/" "$PKG_DIR/platform.txt"
235+
fi
236+
210237
# Add header with version information
211238
echo "Generating core_version.h ..."
212239
ver_define=`echo $RELEASE_TAG | tr "[:lower:].\055" "[:upper:]_"`

0 commit comments

Comments
 (0)