@@ -86,6 +86,10 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
86
86
shift
87
87
log_compilation=$1
88
88
;;
89
+ -d )
90
+ shift
91
+ debug_level=" DebugLevel=$1 "
92
+ ;;
89
93
* )
90
94
break
91
95
;;
@@ -140,13 +144,15 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
140
144
fi
141
145
142
146
# Default FQBN options if none were passed in the command line.
143
-
144
- esp32_opts=" PSRAM=enabled${fqbn_append: +,$fqbn_append } "
145
- esp32s2_opts=" PSRAM=enabled${fqbn_append: +,$fqbn_append } "
146
- esp32s3_opts=" PSRAM=opi,USBMode=default${fqbn_append: +,$fqbn_append } "
147
- esp32c3_opts=" $fqbn_append "
148
- esp32c6_opts=" $fqbn_append "
149
- esp32h2_opts=" $fqbn_append "
147
+ # Replace any double commas with a single one and strip leading and
148
+ # trailing commas.
149
+
150
+ esp32_opts=$( echo " PSRAM=enabled,$debug_level ,$fqbn_append " | sed ' s/^,*//;s/,*$//;s/,\{2,\}/,/g' )
151
+ esp32s2_opts=$( echo " PSRAM=enabled,$debug_level ,$fqbn_append " | sed ' s/^,*//;s/,*$//;s/,\{2,\}/,/g' )
152
+ esp32s3_opts=$( echo " PSRAM=opi,USBMode=default,$debug_level ,$fqbn_append " | sed ' s/^,*//;s/,*$//;s/,\{2,\}/,/g' )
153
+ esp32c3_opts=$( echo " $debug_level ,$fqbn_append " | sed ' s/^,*//;s/,*$//;s/,\{2,\}/,/g' )
154
+ esp32c6_opts=$( echo " $debug_level ,$fqbn_append " | sed ' s/^,*//;s/,*$//;s/,\{2,\}/,/g' )
155
+ esp32h2_opts=$( echo " $debug_level ,$fqbn_append " | sed ' s/^,*//;s/,*$//;s/,\{2,\}/,/g' )
150
156
151
157
# Select the common part of the FQBN based on the target. The rest will be
152
158
# appended depending on the passed options.
0 commit comments