Skip to content

Commit 9300668

Browse files
authored
Merge branch 'master' into netwrk_evnt_lib_refctr
2 parents 1a2d988 + 3502b9c commit 9300668

File tree

298 files changed

+13715
-2576
lines changed

Some content is hidden

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

298 files changed

+13715
-2576
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

+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

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

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

+74-9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
66
TOOLCHAIN_VERSION="12.2.0+20230208"
77
ESPTOOLPY_VERSION="~1.40501.0"
88
ESPRESSIF_ORGANIZATION_NAME="espressif"
9+
SDKCONFIG_DIR="$PLATFORMIO_ESP32_PATH/tools/esp32-arduino-libs"
910

1011
echo "Installing Python Wheel ..."
1112
pip install wheel > /dev/null 2>&1
@@ -88,12 +89,43 @@ function count_sketches(){ # count_sketches <examples-path>
8889
local sketchname=$(basename $sketch)
8990
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
9091
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
91127
fi
92-
is_target=$(jq -r --arg target $target '.targets[$target]' $sketchdir/ci.json)
93-
# If the target is listed as false, skip the sketch. Otherwise, include it.
94-
if [[ "$is_target" == "false" ]]; then
95-
continue
96-
fi
128+
97129
echo $sketch >> sketches.txt
98130
sketchnum=$(($sketchnum + 1))
99131
done
@@ -163,12 +195,45 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
163195
local sketchdir=$(dirname $sketch)
164196
local sketchdirname=$(basename $sketchdir)
165197
local sketchname=$(basename $sketch)
166-
is_target=$(jq -r --arg target $target '.targets[$target]' $sketchdir/ci.json)
167-
# If the target is listed as false, skip the sketch. Otherwise, include it.
168-
if [ "${sketchdirname}.ino" != "$sketchname" ] \
169-
|| [[ "$is_target" == "false" ]]; then
198+
if [[ "$sketchdirname.ino" != "$sketchname" ]]; then
170199
continue
200+
elif [ -f $sketchdir/ci.json ]; then
201+
# If the target is listed as false, skip the sketch. Otherwise, include it.
202+
is_target=$(jq -r '.targets[esp32]' $sketchdir/ci.json)
203+
if [[ "$is_target" == "false" ]]; then
204+
continue
205+
fi
206+
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
234+
fi
171235
fi
236+
172237
sketchnum=$(($sketchnum + 1))
173238
if [ "$sketchnum" -le "$start_index" ] \
174239
|| [ "$sketchnum" -gt "$end_index" ]; then

0 commit comments

Comments
 (0)