File tree Expand file tree Collapse file tree 1 file changed +34
-12
lines changed Expand file tree Collapse file tree 1 file changed +34
-12
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- target=$1
4- chunk_index=$2
5- chunk_max=$3
6-
7- if [ " $chunk_index " -gt " $chunk_max " ] && [ " $chunk_max " -ge 2 ]; then
8- chunk_index=$chunk_max
3+ SCRIPTS_DIR=" ./.github/scripts"
4+ BUILD_CMD=" "
5+
6+ if [ $# -eq 3 ]; then
7+ chunk_build=1
8+ elif [ $# -eq 2 ]; then
9+ chunk_build=0
10+ else
11+ echo " ERROR: Illegal number of parameters"
12+ echo " USAGE:
13+ ${0} <target> <sketch_dir>
14+ ${0} <target> <chunk> <total_chunks>
15+ "
16+ exit 0
917fi
1018
19+ target=$1
20+
1121case " $target " in
1222 " esp32" ) fqbn=" espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
1323 ;;
@@ -22,13 +32,25 @@ if [ -z $fqbn ]; then
2232 exit 0
2333fi
2434
25- SCRIPTS_DIR=" ./.github/scripts"
26- BUILD_SKETCHES=" ${SCRIPTS_DIR} /sketch_utils.sh chunk_build"
27-
2835source ${SCRIPTS_DIR} /install-arduino-ide.sh
2936source ${SCRIPTS_DIR} /install-arduino-core-esp32.sh
3037
31- args=" $ARDUINO_IDE_PATH $ARDUINO_USR_PATH "
32- args+=" \" $fqbn \" $target $PWD /tests $chunk_index $chunk_max "
33- ${BUILD_SKETCHES} ${args}
38+ args=" $ARDUINO_IDE_PATH $ARDUINO_USR_PATH \" $fqbn \" "
39+
40+ if [ $chunk_build -eq 1 ]; then
41+ chunk_index=$2
42+ chunk_max=$3
43+
44+ if [ " $chunk_index " -gt " $chunk_max " ] && [ " $chunk_max " -ge 2 ]; then
45+ chunk_index=$chunk_max
46+ fi
47+ BUILD_CMD=" ${SCRIPTS_DIR} /sketch_utils.sh chunk_build"
48+ args+=" $target $PWD /tests $chunk_index $chunk_max "
49+ else
50+ sketchdir=$2
51+ BUILD_CMD=" ${SCRIPTS_DIR} /sketch_utils.sh build"
52+ args+=" $PWD /tests/$sketchdir /$sketchdir .ino"
53+ fi
54+
55+ ${BUILD_CMD} ${args}
3456
You can’t perform that action at this time.
0 commit comments