Skip to content

Commit 404a31f

Browse files
authoredApr 14, 2021
Initial Esp32c3 Support (#5060)
1 parent 371f382 commit 404a31f

File tree

1,929 files changed

+382829
-186
lines changed

Some content is hidden

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

1,929 files changed

+382829
-186
lines changed
 

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

+29-19
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 \
@@ -131,14 +131,14 @@ function count_sketches() # count_sketches <examples-path> <target-mcu>
131131
local sketchdir=$(dirname $sketch)
132132
local sketchdirname=$(basename $sketchdir)
133133
local sketchname=$(basename $sketch)
134-
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
134+
if [[ "$sketchdirname.ino" != "$sketchname" ]]; then
135135
continue
136-
fi;
137-
if [[ -f "$sketchdir/.skip.$target" ]]; then
136+
elif [[ -f "$sketchdir/.skip.$target" ]]; then
138137
continue
138+
else
139+
echo $sketch >> sketches.txt
140+
sketchnum=$(($sketchnum + 1))
139141
fi
140-
echo $sketch >> sketches.txt
141-
sketchnum=$(($sketchnum + 1))
142142
done
143143
return $sketchnum
144144
}
@@ -168,13 +168,13 @@ function build_sketches() # build_sketches <fqbn> <target-mcu> <examples-path> <
168168
echo "ERROR: Chunks count must be positive number"
169169
return 1
170170
fi
171-
if [ "$chunk_idex" -ge "$chunks_num" ]; then
171+
if [ "$chunk_idex" -ge "$chunks_num" ] && [ "$chunks_num" -ge 2 ]; then
172172
echo "ERROR: Chunk index must be less than chunks count"
173173
return 1
174174
fi
175175

176176
set +e
177-
count_sketches "$examples"
177+
count_sketches "$examples" "$target"
178178
local sketchcount=$?
179179
set -e
180180
local sketches=$(cat sketches.txt)
@@ -186,19 +186,27 @@ function build_sketches() # build_sketches <fqbn> <target-mcu> <examples-path> <
186186
chunk_size=$(( $chunk_size + 1 ))
187187
fi
188188

189-
local start_index=$(( $chunk_idex * $chunk_size ))
190-
if [ "$sketchcount" -le "$start_index" ]; then
191-
echo "Skipping job"
192-
return 0
193-
fi
194-
195-
local end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
196-
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
197193
end_index=$sketchcount
198-
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
199206

200207
local start_num=$(( $start_index + 1 ))
201-
echo "Found $sketchcount Sketches";
208+
echo "Found $sketchcount Sketches for target '$target'";
209+
echo "Chunk Index : $chunk_idex"
202210
echo "Chunk Count : $chunks_num"
203211
echo "Chunk Size : $chunk_size"
204212
echo "Start Sketch: $start_num"
@@ -218,6 +226,8 @@ function build_sketches() # build_sketches <fqbn> <target-mcu> <examples-path> <
218226
|| [ "$sketchnum" -gt "$end_index" ]; then
219227
continue
220228
fi
229+
echo ""
230+
echo "Building Sketch Index $(($sketchnum - 1)) - $sketchdirname"
221231
build_sketch "$fqbn" "$sketch" "$xtra_opts"
222232
local result=$?
223233
if [ $result -ne 0 ]; then

‎.github/scripts/on-push.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ 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
@@ -69,6 +69,19 @@ if [ "$BUILD_PIO" -eq 0 ]; then
6969
else
7070
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
7171
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
7285
else
7386
source ./.github/scripts/install-platformio-esp32.sh
7487
# PlatformIO ESP32 Test

0 commit comments

Comments
 (0)
Please sign in to comment.