|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -LIBS_DIR="tools/esp32-arduino-libs" |
| 3 | +SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" |
4 | 4 |
|
5 | 5 | function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [extra-options]
|
6 | 6 | while [ ! -z "$1" ]; do
|
@@ -83,14 +83,21 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
|
83 | 83 |
|
84 | 84 | len=1
|
85 | 85 |
|
| 86 | + if [ -f $sketchdir/ci.json ]; then |
| 87 | + fqbn_append=`jq -r '.fqbn_append' $sketchdir/ci.json` |
| 88 | + if [ $fqbn_append == "null" ]; then |
| 89 | + fqbn_append="" |
| 90 | + fi |
| 91 | + fi |
| 92 | + |
86 | 93 | # Default FQBN options if none were passed in the command line.
|
87 | 94 |
|
88 |
| - esp32_opts="PSRAM=enabled,PartitionScheme=huge_app,FlashMode=dio" |
89 |
| - esp32s2_opts="PSRAM=enabled,PartitionScheme=huge_app,FlashMode=dio" |
90 |
| - esp32s3_opts="PSRAM=opi,USBMode=default,PartitionScheme=huge_app,FlashMode=dio" |
91 |
| - esp32c3_opts="PartitionScheme=huge_app,FlashMode=dio" |
92 |
| - esp32c6_opts="PartitionScheme=huge_app,FlashMode=dio" |
93 |
| - esp32h2_opts="PartitionScheme=huge_app,FlashMode=dio" |
| 95 | + esp32_opts="PSRAM=enabled,FlashMode=dio${fqbn_append:+,$fqbn_append}" |
| 96 | + esp32s2_opts="PSRAM=enabled,FlashMode=dio${fqbn_append:+,$fqbn_append}" |
| 97 | + esp32s3_opts="PSRAM=opi,USBMode=default,FlashMode=dio${fqbn_append:+,$fqbn_append}" |
| 98 | + esp32c3_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}" |
| 99 | + esp32c6_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}" |
| 100 | + esp32h2_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}" |
94 | 101 |
|
95 | 102 | # Select the common part of the FQBN based on the target. The rest will be
|
96 | 103 | # appended depending on the passed options.
|
@@ -154,7 +161,8 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
|
154 | 161 | requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
155 | 162 | if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
156 | 163 | for requirement in $requirements; do
|
157 |
| - found_line=$(grep -E "^$requirement" $LIBS_DIR/$target/sdkconfig) |
| 164 | + requirement=$(echo $requirement | xargs) |
| 165 | + found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig") |
158 | 166 | if [[ "$found_line" == "" ]]; then
|
159 | 167 | echo "Target $target does not meet the requirement $requirement for $sketchname. Skipping."
|
160 | 168 | exit 0
|
@@ -310,7 +318,8 @@ function count_sketches(){ # count_sketches <path> [target] [file]
|
310 | 318 | requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
311 | 319 | if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
312 | 320 | for requirement in $requirements; do
|
313 |
| - found_line=$(grep -E "^$requirement" $LIBS_DIR/$target/sdkconfig) |
| 321 | + requirement=$(echo $requirement | xargs) |
| 322 | + found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig) |
314 | 323 | if [[ "$found_line" == "" ]]; then
|
315 | 324 | continue 2
|
316 | 325 | fi
|
|
0 commit comments