Skip to content

Commit 46f46a7

Browse files
committed
Merge branch 'master' into pr/4811
2 parents bc7864b + 223acb3 commit 46f46a7

File tree

7,016 files changed

+1214592
-327570
lines changed

Some content is hidden

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

7,016 files changed

+1214592
-327570
lines changed

.github/scripts/check-cmakelists.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ git submodule update --init --recursive
1515
REPO_SRCS=`find cores/esp32/ libraries/ -name 'examples' -prune -o -name '*.c' -print -o -name '*.cpp' -print | sort`
1616

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

20-
if ! diff -u0 --label "Repo Files" --label "COMPONENT_SRCS" <(echo "$REPO_SRCS") <(echo "$CMAKE_SRCS"); then
20+
if ! diff -u0 --label "Repo Files" --label "srcs" <(echo "$REPO_SRCS") <(echo "$CMAKE_SRCS"); then
2121
echo "Source files in repo (-) and source files in CMakeLists.txt (+) don't match"
2222
echo "Edit CMakeLists.txt as appropriate to add/remove source files from COMPONENT_SRCS"
2323
exit 1

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
2323
git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1
2424
fi
2525

26-
echo "Updating Submodules ..."
26+
#echo "Updating Submodules ..."
2727
cd esp32
28-
git submodule update --init --recursive > /dev/null 2>&1
28+
#git submodule update --init --recursive > /dev/null 2>&1
2929

3030
echo "Installing Platform Tools ..."
3131
cd tools && python get.py

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

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
9898
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version -prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
9999
fi
100100

101-
echo ""
102-
echo "Compiling '"$(basename "$sketch")"' ..."
101+
#echo ""
102+
#echo "Compiling '"$(basename "$sketch")"' ..."
103103
mkdir -p "$ARDUINO_BUILD_DIR"
104104
mkdir -p "$ARDUINO_CACHE_DIR"
105105
$ARDUINO_IDE_PATH/arduino-builder -compile -logger=human -core-api-version=10810 \
@@ -116,9 +116,10 @@ function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
116116
$win_opts $xtra_opts "$sketch"
117117
}
118118

119-
function count_sketches() # count_sketches <examples-path>
119+
function count_sketches() # count_sketches <examples-path> <target-mcu>
120120
{
121121
local examples="$1"
122+
local target="$2"
122123
rm -rf sketches.txt
123124
if [ ! -d "$examples" ]; then
124125
touch sketches.txt
@@ -130,49 +131,50 @@ function count_sketches() # count_sketches <examples-path>
130131
local sketchdir=$(dirname $sketch)
131132
local sketchdirname=$(basename $sketchdir)
132133
local sketchname=$(basename $sketch)
133-
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
134+
if [[ "$sketchdirname.ino" != "$sketchname" ]]; then
134135
continue
135-
fi;
136-
if [[ -f "$sketchdir/.test.skip" ]]; then
136+
elif [[ -f "$sketchdir/.skip.$target" ]]; then
137137
continue
138+
else
139+
echo $sketch >> sketches.txt
140+
sketchnum=$(($sketchnum + 1))
138141
fi
139-
echo $sketch >> sketches.txt
140-
sketchnum=$(($sketchnum + 1))
141142
done
142143
return $sketchnum
143144
}
144145

145-
function build_sketches() # build_sketches <fqbn> <examples-path> <chunk> <total-chunks> [extra-options]
146+
function build_sketches() # build_sketches <fqbn> <target-mcu> <examples-path> <chunk> <total-chunks> [extra-options]
146147
{
147148
local fqbn=$1
148-
local examples=$2
149-
local chunk_idex=$3
150-
local chunks_num=$4
151-
local xtra_opts=$5
149+
local target="$2"
150+
local examples=$3
151+
local chunk_idex=$4
152+
local chunks_num=$5
153+
local xtra_opts=$6
152154

153-
if [ "$#" -lt 2 ]; then
155+
if [ "$#" -lt 3 ]; then
154156
echo "ERROR: Illegal number of parameters"
155-
echo "USAGE: build_sketches <fqbn> <examples-path> [<chunk> <total-chunks>] [extra-options]"
157+
echo "USAGE: build_sketches <fqbn> <target-mcu <examples-path> [<chunk> <total-chunks>] [extra-options]"
156158
return 1
157159
fi
158160

159-
if [ "$#" -lt 4 ]; then
161+
if [ "$#" -lt 5 ]; then
160162
chunk_idex="0"
161163
chunks_num="1"
162-
xtra_opts=$3
164+
xtra_opts=$4
163165
fi
164166

165167
if [ "$chunks_num" -le 0 ]; then
166168
echo "ERROR: Chunks count must be positive number"
167169
return 1
168170
fi
169-
if [ "$chunk_idex" -ge "$chunks_num" ]; then
171+
if [ "$chunk_idex" -ge "$chunks_num" ] && [ "$chunks_num" -ge 2 ]; then
170172
echo "ERROR: Chunk index must be less than chunks count"
171173
return 1
172174
fi
173175

174176
set +e
175-
count_sketches "$examples"
177+
count_sketches "$examples" "$target"
176178
local sketchcount=$?
177179
set -e
178180
local sketches=$(cat sketches.txt)
@@ -184,19 +186,27 @@ function build_sketches() # build_sketches <fqbn> <examples-path> <chunk> <total
184186
chunk_size=$(( $chunk_size + 1 ))
185187
fi
186188

187-
local start_index=$(( $chunk_idex * $chunk_size ))
188-
if [ "$sketchcount" -le "$start_index" ]; then
189-
echo "Skipping job"
190-
return 0
191-
fi
192-
193-
local end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
194-
if [ "$end_index" -gt "$sketchcount" ]; then
189+
local start_index=0
190+
local end_index=0
191+
if [ "$chunk_idex" -ge "$chunks_num" ]; then
192+
start_index=$chunk_idex
195193
end_index=$sketchcount
196-
fi
194+
else
195+
start_index=$(( $chunk_idex * $chunk_size ))
196+
if [ "$sketchcount" -le "$start_index" ]; then
197+
echo "Skipping job"
198+
return 0
199+
fi
200+
201+
end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
202+
if [ "$end_index" -gt "$sketchcount" ]; then
203+
end_index=$sketchcount
204+
fi
205+
fi
197206

198207
local start_num=$(( $start_index + 1 ))
199-
echo "Found $sketchcount Sketches";
208+
echo "Found $sketchcount Sketches for target '$target'";
209+
echo "Chunk Index : $chunk_idex"
200210
echo "Chunk Count : $chunks_num"
201211
echo "Chunk Size : $chunk_size"
202212
echo "Start Sketch: $start_num"
@@ -208,14 +218,16 @@ function build_sketches() # build_sketches <fqbn> <examples-path> <chunk> <total
208218
local sketchdirname=$(basename $sketchdir)
209219
local sketchname=$(basename $sketch)
210220
if [ "${sketchdirname}.ino" != "$sketchname" ] \
211-
|| [ -f "$sketchdir/.test.skip" ]; then
221+
|| [ -f "$sketchdir/.skip.$target" ]; then
212222
continue
213223
fi
214224
sketchnum=$(($sketchnum + 1))
215225
if [ "$sketchnum" -le "$start_index" ] \
216226
|| [ "$sketchnum" -gt "$end_index" ]; then
217227
continue
218228
fi
229+
echo ""
230+
echo "Building Sketch Index $(($sketchnum - 1)) - $sketchdirname"
219231
build_sketch "$fqbn" "$sketch" "$xtra_opts"
220232
local result=$?
221233
if [ $result -ne 0 ]; then

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

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32"
4+
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/idf-v4.0"
45

56
echo "Installing Python Wheel ..."
67
pip install wheel > /dev/null 2>&1
@@ -9,10 +10,10 @@ echo "Installing PlatformIO ..."
910
pip install -U https://github.com/platformio/platformio/archive/develop.zip > /dev/null 2>&1
1011

1112
echo "Installing Platform ESP32 ..."
12-
python -m platformio platform install https://github.com/platformio/platform-espressif32.git > /dev/null 2>&1
13+
python -m platformio platform install $PLATFORMIO_ESP32_URL > /dev/null 2>&1
1314

1415
echo "Replacing the framework version ..."
15-
python -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoespressif32']['version'] = '*'; del data['packages']['framework-arduinoespressif32']['owner']; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()"
16+
python -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoespressif32']['version'] = '*'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()"
1617

1718
if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then
1819
echo "Linking Core..."
@@ -25,19 +26,20 @@ fi
2526
echo "PlatformIO for ESP32 has been installed"
2627
echo ""
2728

28-
function build_pio_sketch(){ # build_pio_sketch <board> <path-to-ino>
29-
if [ "$#" -lt 2 ]; then
29+
function build_pio_sketch(){ # build_pio_sketch <board> <options> <path-to-ino>
30+
if [ "$#" -lt 3 ]; then
3031
echo "ERROR: Illegal number of parameters"
31-
echo "USAGE: build_pio_sketch <board> <path-to-ino>"
32+
echo "USAGE: build_pio_sketch <board> <options> <path-to-ino>"
3233
return 1
3334
fi
3435

3536
local board="$1"
36-
local sketch="$2"
37+
local options="$2"
38+
local sketch="$3"
3739
local sketch_dir=$(dirname "$sketch")
3840
echo ""
3941
echo "Compiling '"$(basename "$sketch")"' ..."
40-
python -m platformio ci --board "$board" "$sketch_dir" --project-option="board_build.partitions = huge_app.csv"
42+
python -m platformio ci --board "$board" "$sketch_dir" --project-option="$options"
4143
}
4244

4345
function count_sketches() # count_sketches <examples-path>
@@ -66,20 +68,21 @@ function count_sketches() # count_sketches <examples-path>
6668
return $sketchnum
6769
}
6870

69-
function build_pio_sketches() # build_pio_sketches <board> <examples-path> <chunk> <total-chunks>
71+
function build_pio_sketches() # build_pio_sketches <board> <options> <examples-path> <chunk> <total-chunks>
7072
{
71-
if [ "$#" -lt 2 ]; then
73+
if [ "$#" -lt 3 ]; then
7274
echo "ERROR: Illegal number of parameters"
73-
echo "USAGE: build_pio_sketches <board> <examples-path> [<chunk> <total-chunks>]"
75+
echo "USAGE: build_pio_sketches <board> <options> <examples-path> [<chunk> <total-chunks>]"
7476
return 1
7577
fi
7678

7779
local board=$1
78-
local examples=$2
79-
local chunk_idex=$3
80-
local chunks_num=$4
80+
local options="$2"
81+
local examples=$3
82+
local chunk_idex=$4
83+
local chunks_num=$5
8184

82-
if [ "$#" -lt 4 ]; then
85+
if [ "$#" -lt 5 ]; then
8386
chunk_idex="0"
8487
chunks_num="1"
8588
fi
@@ -138,7 +141,7 @@ function build_pio_sketches() # build_pio_sketches <board> <examples-path> <chun
138141
|| [ "$sketchnum" -gt "$end_index" ]; then
139142
continue
140143
fi
141-
build_pio_sketch "$board" "$sketch"
144+
build_pio_sketch "$board" "$options" "$sketch"
142145
local result=$?
143146
if [ $result -ne 0 ]; then
144147
return $result

.github/scripts/on-pages.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,15 @@ function git_safe_upload_to_pages(){
8787

8888
EVENT_JSON=`cat $GITHUB_EVENT_PATH`
8989

90+
echo "GITHUB_EVENT_PATH: $GITHUB_EVENT_PATH"
91+
echo "EVENT_JSON: $EVENT_JSON"
92+
9093
pages_added=`echo "$EVENT_JSON" | jq -r '.commits[].added[]'`
94+
echo "added: $pages_added"
9195
pages_modified=`echo "$EVENT_JSON" | jq -r '.commits[].modified[]'`
96+
echo "modified: $pages_modified"
9297
pages_removed=`echo "$EVENT_JSON" | jq -r '.commits[].removed[]'`
98+
echo "removed: $pages_removed"
9399

94100
for page in $pages_added; do
95101
if [[ $page != "README.md" && $page != "docs/"* ]]; then

.github/scripts/on-push.sh

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,81 @@ BUILD_PIO=0
2424
if [ "$#" -lt 2 ] || [ "$CHUNKS_CNT" -le 0 ]; then
2525
CHUNK_INDEX=0
2626
CHUNKS_CNT=1
27-
elif [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ]; then
27+
elif [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ] && [ "$CHUNKS_CNT" -ge 2 ]; then
2828
CHUNK_INDEX=$CHUNKS_CNT
2929
elif [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
3030
BUILD_PIO=1
3131
fi
3232

33-
echo "Updating submodules ..."
34-
git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1
33+
#echo "Updating submodules ..."
34+
#git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1
3535

3636
if [ "$BUILD_PIO" -eq 0 ]; then
37-
# ArduinoIDE Test
37+
# ArduinoIDE ESP32 Test
38+
TARGET="esp32"
3839
FQBN="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
3940
source ./.github/scripts/install-arduino-ide.sh
4041
source ./.github/scripts/install-arduino-core-esp32.sh
4142
if [ "$OS_IS_WINDOWS" == "1" ]; then
4243
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
4344
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
44-
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \
4545
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
4646
elif [ "$OS_IS_MACOS" == "1" ]; then
4747
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
4848
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
4949
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
5050
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
51-
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \
5251
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
5352
else
5453
# CMake Test
5554
if [ "$CHUNK_INDEX" -eq 0 ]; then
5655
bash "$ARDUINO_ESP32_PATH/.github/scripts/check-cmakelists.sh"
5756
fi
58-
build_sketches "$FQBN" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
57+
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
5958
fi
59+
60+
# ArduinoIDE ESP32S2 Test
61+
TARGET="esp32s2"
62+
FQBN="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
63+
if [ "$OS_IS_WINDOWS" == "1" ]; then
64+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
65+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
66+
elif [ "$OS_IS_MACOS" == "1" ]; then
67+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
68+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
69+
else
70+
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
71+
fi
72+
73+
# ArduinoIDE ESP32C3 Test
74+
TARGET="esp32c3"
75+
FQBN="espressif:esp32:esp32c3:PartitionScheme=huge_app"
76+
if [ "$OS_IS_WINDOWS" == "1" ]; then
77+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
78+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
79+
elif [ "$OS_IS_MACOS" == "1" ]; then
80+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
81+
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
82+
else
83+
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
84+
fi
6085
else
61-
# PlatformIO Test
6286
source ./.github/scripts/install-platformio-esp32.sh
87+
# PlatformIO ESP32 Test
6388
BOARD="esp32dev"
64-
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
65-
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
66-
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
67-
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
68-
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \
69-
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
70-
#build_pio_sketches esp32dev "$PLATFORMIO_ESP32_PATH/libraries"
89+
OPTIONS="board_build.partitions = huge_app.csv"
90+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
91+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
92+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
93+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
94+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
95+
96+
# PlatformIO ESP32 Test
97+
# OPTIONS="board_build.mcu = esp32s2"
98+
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
99+
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
100+
101+
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s2" --project-option="board_build.partitions = huge_app.csv"
102+
103+
#build_pio_sketches "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries"
71104
fi

0 commit comments

Comments
 (0)