File tree 1 file changed +34
-12
lines changed
1 file changed +34
-12
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
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
9
17
fi
10
18
19
+ target=$1
20
+
11
21
case " $target " in
12
22
" esp32" ) fqbn=" espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
13
23
;;
@@ -22,13 +32,25 @@ if [ -z $fqbn ]; then
22
32
exit 0
23
33
fi
24
34
25
- SCRIPTS_DIR=" ./.github/scripts"
26
- BUILD_SKETCHES=" ${SCRIPTS_DIR} /sketch_utils.sh chunk_build"
27
-
28
35
source ${SCRIPTS_DIR} /install-arduino-ide.sh
29
36
source ${SCRIPTS_DIR} /install-arduino-core-esp32.sh
30
37
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}
34
56
You can’t perform that action at this time.
0 commit comments