@@ -21,6 +21,8 @@ export SAMD_PLATFORMS='declare -A samd_platforms=( [zero]="arduino:samd:arduino_
21
21
22
22
export M4_PLATFORMS=' declare -A m4_platforms=( [m4]="adafruit:samd:adafruit_metro_m4" )'
23
23
24
+ export IO_PLATFORMS=' declare -A io_platforms=( [zero]="arduino:samd:arduino_zero_native" [esp8266]="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80" [esp32]="espressif:esp32:featheresp32:FlashFreq=80" )'
25
+
24
26
# make display available for arduino CLI
25
27
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
26
28
sleep 3
@@ -106,6 +108,7 @@ function build_platform()
106
108
eval $AUX_PLATFORMS
107
109
eval $CPLAY_PLATFORMS
108
110
eval $M4_PLATFORMS
111
+ eval $IO_PLATFORMS
109
112
110
113
# reset platform json var
111
114
PLATFORM_JSON=" "
@@ -137,6 +140,8 @@ function build_platform()
137
140
platform=${cplay_platforms[$platform_key]}
138
141
elif [[ ${m4_platforms[$platform_key]} ]]; then
139
142
platform=${m4_platforms[$platform_key]}
143
+ elif [[ ${io_platforms[$platform_key]} ]]; then
144
+ platform=${io_platforms[$platform_key]}
140
145
else
141
146
echo " NON-STANDARD PLATFORM KEY: $platform_key "
142
147
platform=$platform_key
@@ -494,6 +499,54 @@ function build_m4_platforms()
494
499
495
500
}
496
501
502
+ function build_io_platforms()
503
+ {
504
+
505
+ # arrays can't be exported, so we have to eval
506
+ eval $IO_PLATFORMS
507
+
508
+ # track the build status all platforms
509
+ local exit_code=0
510
+
511
+ # var to hold platforms
512
+ local platforms_json=" "
513
+
514
+ # get the last element in the array
515
+ local last=" ${io_platforms[@]: (-1)} "
516
+
517
+ # loop through platforms in main platforms assoc array
518
+ for p_key in " ${! io_platforms[@]} " ; do
519
+
520
+ # is this the last platform in the loop
521
+ local last_platform=0
522
+ if [ " $last " == " ${io_platforms[$p_key]} " ]; then
523
+ last_platform=1
524
+ fi
525
+
526
+ # build all examples for this platform
527
+ build_platform $p_key
528
+
529
+ # check if build failed
530
+ if [ $? -ne 0 ]; then
531
+ platforms_json=" ${platforms_json} $( json_platform $p_key 0 " $PLATFORM_JSON " $last_platform ) "
532
+ exit_code=1
533
+ else
534
+ platforms_json=" ${platforms_json} $( json_platform $p_key 1 " $PLATFORM_JSON " $last_platform ) "
535
+ fi
536
+
537
+ done
538
+
539
+ # exit code is opposite of json build status
540
+ if [ $exit_code -eq 0 ]; then
541
+ json_main_platforms 1 " $platforms_json "
542
+ else
543
+ json_main_platforms 0 " $platforms_json "
544
+ fi
545
+
546
+ return $exit_code
547
+
548
+ }
549
+
497
550
# generate json string for a sketch
498
551
function json_sketch()
499
552
{
0 commit comments