Skip to content

Commit 13d84eb

Browse files
authored
Merge branch 'espressif:master' into master
2 parents d8c26d6 + 2fecc48 commit 13d84eb

File tree

632 files changed

+28976
-5685
lines changed

Some content is hidden

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

632 files changed

+28976
-5685
lines changed

.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}]

.github/ISSUE_TEMPLATE/Issue-report.yml

+17-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8-
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
8+
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
99
* Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html)
1010
* Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
1111
* If still experiencing the issue, please provide as many details as possible below about your hardware, computer setup and code.
@@ -24,7 +24,7 @@ body:
2424
description: What development board or other hardware is the chip attached to?
2525
placeholder: ex. DevKitC, plain module on breadboard, etc. If your hardware is custom or unusual, please attach a photo.
2626
validations:
27-
required: true
27+
required: true
2828
- type: textarea
2929
id: other-hw
3030
attributes:
@@ -41,6 +41,10 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v3.1.0
45+
- v3.0.7
46+
- v3.0.6
47+
- v3.0.5
4448
- v3.0.4
4549
- v3.0.3
4650
- v3.0.2
@@ -58,7 +62,7 @@ body:
5862
- v2.0.8
5963
- v2.0.7
6064
- v2.0.6
61-
- v2.0.5
65+
- v2.0.5
6266
- v2.0.4
6367
- v2.0.3
6468
- v2.0.2
@@ -73,9 +77,9 @@ body:
7377
attributes:
7478
label: IDE Name
7579
description: What IDE are you using?
76-
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
80+
placeholder: eg. Arduino IDE, VSCode, Sloeber...
7781
validations:
78-
required: true
82+
required: true
7983
- type: input
8084
id: os
8185
attributes:
@@ -93,13 +97,13 @@ body:
9397
validations:
9498
required: true
9599
- type: dropdown
96-
id: PSRAM
100+
id: PSRAM
97101
attributes:
98102
label: PSRAM enabled
99103
description: Is PSRAM enabled?
100104
options:
101-
- 'yes'
102-
- 'no'
105+
- "yes"
106+
- "no"
103107
validations:
104108
required: true
105109
- type: input
@@ -114,8 +118,8 @@ body:
114118
id: Description
115119
attributes:
116120
label: Description
117-
description: Please describe your problem here and expected behaviour
118-
placeholder: ex. Can't connect/weird behaviour/wrong function/missing parameter..
121+
description: Please describe your problem here and expected behavior
122+
placeholder: ex. Can't connect/weird behavior/wrong function/missing parameter..
119123
validations:
120124
required: true
121125
- type: textarea
@@ -126,7 +130,7 @@ body:
126130
placeholder: ex. Related part of the code to replicate the issue
127131
render: cpp
128132
validations:
129-
required: true
133+
required: true
130134
- type: textarea
131135
id: Debug
132136
attributes:
@@ -135,11 +139,11 @@ body:
135139
placeholder: Enable Core debug level - Debug on tools menu of Arduino IDE, then put the serial output here.
136140
render: plain
137141
validations:
138-
required: true
142+
required: true
139143
- type: textarea
140144
id: other-remarks
141145
attributes:
142-
label: Other Steps to Reproduce
146+
label: Other Steps to Reproduce
143147
description: Is there any other information you can think of which will help us reproduce this problem? Any additional info can be added as well.
144148
placeholder: ex. I also tried on other OS, HW...it works correctly on that setup.
145149
- type: checkboxes

.github/ISSUE_TEMPLATE/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Arduino ESP32 Gitter Channel
4-
url: https://gitter.im/espressif/arduino-esp32
5-
about: Community channel for questions and help
3+
- name: Arduino Core for Espressif Discord Server
4+
url: https://discord.gg/8xY6e9crwv
5+
about: Community Discord server for questions and help
66
- name: ESP32 Forum - Arduino
77
url: https://esp32.com/viewforum.php?f=19
8-
about: Official Forum for questions
8+
about: Official Forum for questions

.github/scripts/check-cmakelists.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
23
#
34
# This script is used in the CI workflow. It checks all non-examples source files in libraries/ and cores/ are listed in
45
# CMakeLists.txt for the cmake-based IDF component
@@ -12,10 +13,10 @@ set -e
1213
git submodule update --init --recursive
1314

1415
# find all source files in repo
15-
REPO_SRCS=`find cores/esp32/ libraries/ -name 'examples' -prune -o -name '*.c' -print -o -name '*.cpp' -print | sort`
16+
REPO_SRCS=$(find cores/esp32/ libraries/ -name 'examples' -prune -o -name '*.c' -print -o -name '*.cpp' -print | sort)
1617

1718
# find all source files named in CMakeLists.txt COMPONENT_SRCS
18-
CMAKE_SRCS=`cmake --trace-expand -P CMakeLists.txt 2>&1 | grep set\(srcs | cut -d'(' -f3 | sed 's/ )//' | sed 's/srcs //' | tr ' ;' '\n' | sort`
19+
CMAKE_SRCS=$(cmake --trace-expand -P CMakeLists.txt 2>&1 | grep set\(srcs | cut -d'(' -f3 | sed 's/ )//' | sed 's/srcs //' | tr ' ;' '\n' | sort)
1920

2021
if ! diff -u0 --label "Repo Files" --label "srcs" <(echo "$REPO_SRCS") <(echo "$CMAKE_SRCS"); then
2122
echo "Source files in repo (-) and source files in CMakeLists.txt (+) don't match"

.github/scripts/find_all_boards.sh

+12-13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# Get all boards
44
boards_array=()
55

6-
for line in `grep '.tarch=' boards.txt`; do
6+
boards_list=$(grep '.tarch=' boards.txt)
7+
8+
while read -r line; do
79
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
810
# skip esp32c2 as we dont build libs for it
911
if [ "$board_name" == "esp32c2" ]; then
@@ -12,29 +14,26 @@ for line in `grep '.tarch=' boards.txt`; do
1214
fi
1315
boards_array+=("espressif:esp32:$board_name")
1416
echo "Added 'espressif:esp32:$board_name' to array"
15-
done
17+
done <<< "$boards_list"
1618

1719
# Create JSON like string with all boards found and pass it to env variable
1820
board_count=${#boards_array[@]}
1921
echo "Boards found: $board_count"
20-
echo "BOARD-COUNT=$board_count" >> $GITHUB_ENV
22+
echo "BOARD-COUNT=$board_count" >> "$GITHUB_ENV"
2123

22-
if [ $board_count -gt 0 ]
23-
then
24+
if [ "$board_count" -gt 0 ]; then
2425
json_matrix='['
25-
for board in ${boards_array[@]}
26-
do
26+
for board in "${boards_array[@]}"; do
2727
json_matrix+='"'$board'"'
28-
if [ $board_count -gt 1 ]
29-
then
28+
if [ "$board_count" -gt 1 ]; then
3029
json_matrix+=","
3130
fi
32-
board_count=$(($board_count - 1))
31+
board_count=$((board_count - 1))
3332
done
3433
json_matrix+=']'
3534

36-
echo $json_matrix
37-
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
35+
echo "$json_matrix"
36+
echo "FQBNS=${json_matrix}" >> "$GITHUB_ENV"
3837
else
39-
echo "FQBNS=" >> $GITHUB_ENV
38+
echo "FQBNS=" >> "$GITHUB_ENV"
4039
fi

.github/scripts/find_new_boards.sh

+31-59
Original file line numberDiff line numberDiff line change
@@ -2,89 +2,61 @@
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 '@@[^@]*@@')
13+
# Check if the diff is empty
14+
if [ -z "$diff" ]; then
15+
echo "No changes in boards.txt file"
16+
echo "FQBNS="
17+
exit 0
18+
fi
1519

16-
params_array=()
20+
# Extract added or modified lines (lines starting with '+' or '-')
21+
modified_lines=$(echo "$diff" | grep -E '^[+-][^+-]')
1722

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
23+
# Print the modified lines for debugging
24+
echo "Modified lines:"
25+
echo "$modified_lines"
2526

2627
boards_array=()
2728
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
4329

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
30+
# Extract board names from the modified lines, and add them to the boards_array
31+
while read -r line; do
5632
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
57-
if [ "$board_name" != "" ] && [ "$board_name" != "esp32_family" ]
58-
then
59-
if [ "$board_name" != "$previous_board" ]
60-
then
33+
# remove + or - from the board name at the beginning
34+
board_name=${board_name#[-+]}
35+
if [ "$board_name" != "" ] && [ "$board_name" != "+" ] && [ "$board_name" != "-" ] && [ "$board_name" != "esp32_family" ]; then
36+
if [ "$board_name" != "$previous_board" ]; then
6137
boards_array+=("espressif:esp32:$board_name")
6238
previous_board="$board_name"
6339
echo "Added 'espressif:esp32:$board_name' to array"
6440
fi
6541
fi
66-
done < "$file"
67-
done
42+
done <<< "$modified_lines"
6843

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

72-
if [ $board_count -gt 0 ]
73-
then
47+
if [ "$board_count" -gt 0 ]; then
7448
json_matrix='{"fqbn": ['
75-
for board in ${boards_array[@]}
76-
do
49+
for board in "${boards_array[@]}"; do
7750
json_matrix+='"'$board'"'
78-
if [ $board_count -gt 1 ]
79-
then
51+
if [ "$board_count" -gt 1 ]; then
8052
json_matrix+=","
8153
fi
82-
board_count=$(($board_count - 1))
54+
board_count=$((board_count - 1))
8355
done
8456
json_matrix+=']}'
8557

86-
echo $json_matrix
87-
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
58+
echo "$json_matrix"
59+
echo "FQBNS=${json_matrix}" >> "$GITHUB_ENV"
8860
else
89-
echo "FQBNS=" >> $GITHUB_ENV
90-
fi
61+
echo "FQBNS=" >> "$GITHUB_ENV"
62+
fi

.github/scripts/install-arduino-cli.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
OSBITS=`uname -m`
3+
OSBITS=$(uname -m)
44
if [[ "$OSTYPE" == "linux"* ]]; then
55
export OS_IS_LINUX="1"
66
if [[ "$OSBITS" == "i686" ]]; then
@@ -49,4 +49,3 @@ if [ ! -d "$ARDUINO_IDE_PATH" ] || [ ! -f "$ARDUINO_IDE_PATH/arduino-cli" ]; the
4949
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$ARDUINO_IDE_PATH" sh
5050
fi
5151
fi
52-

.github/scripts/install-arduino-core-esp32.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
55
echo "Installing ESP32 Arduino Core ..."
66
script_init_path="$PWD"
77
mkdir -p "$ARDUINO_USR_PATH/hardware/espressif"
8-
cd "$ARDUINO_USR_PATH/hardware/espressif"
8+
cd "$ARDUINO_USR_PATH/hardware/espressif" || exit
99

1010
echo "Installing Python Serial ..."
1111
pip install pyserial > /dev/null
@@ -15,25 +15,25 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
1515
pip install requests > /dev/null
1616
fi
1717

18-
if [ ! -z "$GITHUB_REPOSITORY" ]; then
18+
if [ -n "$GITHUB_REPOSITORY" ]; then
1919
echo "Linking Core..."
20-
ln -s $GITHUB_WORKSPACE esp32
20+
ln -s "$GITHUB_WORKSPACE" esp32
2121
else
2222
echo "Cloning Core Repository..."
2323
git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1
2424
fi
2525

2626
#echo "Updating Submodules ..."
27-
cd esp32
27+
cd esp32 || exit
2828
#git submodule update --init --recursive > /dev/null 2>&1
2929

3030
echo "Installing Platform Tools ..."
3131
if [ "$OS_IS_WINDOWS" == "1" ]; then
32-
cd tools && ./get.exe
32+
cd tools && ./get.exe
3333
else
34-
cd tools && python get.py
34+
cd tools && python get.py
3535
fi
36-
cd $script_init_path
36+
cd "$script_init_path" || exit
3737

3838
echo "ESP32 Arduino has been installed in '$ARDUINO_ESP32_PATH'"
3939
echo ""

.github/scripts/install-arduino-ide.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#OSTYPE: 'msys', ARCH: 'x86_64' => win32
55
#OSTYPE: 'darwin18', ARCH: 'i386' => macos
66

7-
OSBITS=`uname -m`
7+
OSBITS=$(uname -m)
88
if [[ "$OSTYPE" == "linux"* ]]; then
99
export OS_IS_LINUX="1"
1010
ARCHIVE_FORMAT="tar.xz"
@@ -77,4 +77,3 @@ if [ ! -d "$ARDUINO_IDE_PATH" ]; then
7777
echo "Arduino IDE Installed in '$ARDUINO_IDE_PATH'"
7878
echo ""
7979
fi
80-

0 commit comments

Comments
 (0)