@@ -109,21 +109,41 @@ function format_fqbn()
109
109
local board_name=$1
110
110
local flash_size=$2
111
111
local lwip=$3
112
+ local debug=$4
112
113
113
- echo $" esp8266com:esp8266:${board_name} :
114
- eesz=${flash_size} ,
115
- ip=${lwip} "
114
+ printf ' esp8266com:esp8266:%s:eesz=%s,ip=%s,lvl=%s' \
115
+ " $board_name " \
116
+ " $flash_size " \
117
+ " $lwip " \
118
+ " $debug "
119
+ }
120
+
121
+ function format_cli()
122
+ {
123
+ local cli_path=$1
124
+ local warnings=$2
125
+ local fqbn=$3
126
+ local libraries=$4
127
+ local output_dir=$5
128
+
129
+ printf " %s compile --warnings=%s --fqbn=%s --libraries=%s --output-dir=%s" \
130
+ " $cli_path " \
131
+ " $warnings " \
132
+ " $fqbn " \
133
+ " $libraries " \
134
+ " $output_dir "
116
135
}
117
136
118
137
function build_sketches()
119
138
{
120
139
local core_path=$1
121
140
local cli_path=$2
122
141
local library_path=$3
123
- local lwip=$4
124
- local build_mod=$5
125
- local build_rem=$6
126
- local build_cnt=$7
142
+ local debug=$4
143
+ local lwip=$5
144
+ local build_mod=$6
145
+ local build_rem=$7
146
+ local build_cnt=$8
127
147
128
148
local build_dir=" $cache_dir " /build
129
149
mkdir -p " $build_dir "
@@ -132,16 +152,11 @@ function build_sketches()
132
152
mkdir -p " $build_out "
133
153
134
154
local fqbn
135
- fqbn=$( format_fqbn " generic" " 4M1M" " $lwip " )
155
+ fqbn=$( format_fqbn " generic" " 4M1M" " $lwip " " $debug " )
136
156
echo " FQBN: $fqbn "
137
157
138
158
local build_cmd
139
- build_cmd=$' ' " ${cli_path} " '
140
- compile
141
- --warnings=all
142
- --fqbn ' " $fqbn " '
143
- --libraries ' " $library_path " '
144
- --output-dir ' " $build_out " ' '
159
+ build_cmd=$( format_cli " $cli_path " " all" " $fqbn " " $library_path " " $build_out " )
145
160
146
161
print_size_info_header > " $cache_dir " /size.log
147
162
@@ -300,30 +315,19 @@ function install_core()
300
315
local hardware_core_path=$2
301
316
local debug=$3
302
317
303
- pushd " ${core_path} "
304
-
305
- local debug_flags=" "
306
- if [ " $debug " = " debug" ]; then
307
- debug_flags=$' -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
308
- -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
309
- -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM'
310
- fi
311
-
312
318
# Set our custom warnings for all builds
313
319
printf " %s\n" \
314
- " compiler.c.extra_flags=-Wall -Wextra $debug_flags " \
315
- " compiler.cpp.extra_flags=-Wall -Wextra $debug_flags " \
320
+ " compiler.c.extra_flags=-Wall -Wextra" \
321
+ " compiler.cpp.extra_flags=-Wall -Wextra" \
316
322
" recipe.hooks.prebuild.1.pattern=\" {runtime.tools.python3.path}/python3\" -I \" {runtime.tools.makecorever}\" --git-root \" {runtime.platform.path}\" --version \" {version}\" \" {runtime.platform.path}/cores/esp8266/core_version.h\" " \
317
323
> " ${core_path} " /platform.local.txt
318
324
echo -e " \n----platform.local.txt----"
319
- cat platform.local.txt
325
+ cat " ${core_path} " / platform.local.txt
320
326
echo -e " \n----\n"
321
327
322
328
# Fetch toolchain & filesystem utils
323
- pushd tools
329
+ pushd " ${core_path} " / tools
324
330
python3 get.py -q
325
-
326
- popd
327
331
popd
328
332
329
333
# todo: windows runners are using copied tree
@@ -341,11 +345,10 @@ function install_core()
341
345
function install_arduino()
342
346
{
343
347
echo ${ci_group} Install arduino
344
- local debug=$1
345
348
346
349
local hardware_core_path=" $ESP8266_ARDUINO_HARDWARE /esp8266com/esp8266"
347
350
test -d " $hardware_core_path " \
348
- || install_core " $ESP8266_ARDUINO_BUILD_DIR " " $hardware_core_path " " $debug "
351
+ || install_core " $ESP8266_ARDUINO_BUILD_DIR " " $hardware_core_path "
349
352
350
353
command -v " ${ESP8266_ARDUINO_CLI} " \
351
354
|| install_arduino_cli " ${ESP8266_ARDUINO_CLI} " " $hardware_core_path "
@@ -364,6 +367,9 @@ function arduino_lwip_menu_option()
364
367
" IPv6" )
365
368
echo " lm6f"
366
369
;;
370
+ * )
371
+ echo " unknown"
372
+ ;;
367
373
esac
368
374
}
369
375
@@ -415,17 +421,19 @@ function arduino_mkbuildoptglobals_cleanup()
415
421
416
422
function build_sketches_with_arduino()
417
423
{
424
+ local debug=$1
425
+
418
426
local lwip
419
- lwip=$( arduino_lwip_menu_option $1 )
427
+ lwip=$( arduino_lwip_menu_option " $2 " )
420
428
421
- local build_mod=$2
422
- local build_rem=$3
423
- local build_cnt=$4
429
+ local build_mod=$3
430
+ local build_rem=$4
431
+ local build_cnt=$5
424
432
425
433
build_sketches " $ESP8266_ARDUINO_BUILD_DIR " \
426
434
" $ESP8266_ARDUINO_CLI " \
427
435
" $ESP8266_ARDUINO_LIBRARIES " \
428
- " $lwip " " $build_mod " " $build_rem " " $build_cnt "
436
+ " $debug " " $ lwip" " $build_mod " " $build_rem " " $build_cnt "
429
437
step_summary " Size report" " $cache_dir /size.log"
430
438
}
431
439
0 commit comments