From fe2391ffe9e1e14e3dbd690de99789be0811002d Mon Sep 17 00:00:00 2001 From: Antoine Beauchamp Date: Mon, 5 Aug 2024 17:51:27 -0400 Subject: [PATCH] Modified `arduino_build_sketch.*` scripts to build all examples for ARDUINO NANO, ESP8266 and ESP32 boards. --- ci/linux/arduino_build_sketch.sh | 22 ++++++++++++++++++++-- ci/windows/arduino_build_sketch.bat | 24 ++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/ci/linux/arduino_build_sketch.sh b/ci/linux/arduino_build_sketch.sh index 9316b21..d8126c1 100755 --- a/ci/linux/arduino_build_sketch.sh +++ b/ci/linux/arduino_build_sketch.sh @@ -22,9 +22,27 @@ echo export ARDUINO_INO_FILE=$PRODUCT_SOURCE_DIR/examples/$1/$1.ino echo ========================================================================================================== -echo Compiling $ARDUINO_INO_FILE +echo Compiling $ARDUINO_INO_FILE (atmega328) echo ========================================================================================================== cd $PRODUCT_SOURCE_DIR/examples/$1 -arduino-cli compile -b arduino:avr:nano:cpu=atmega328 $1.ino +arduino-cli compile --fqbn "arduino:avr:nano:cpu=atmega328" "$1.ino" +echo +echo + +echo ========================================================================================================== +echo Compiling $ARDUINO_INO_FILE (esp8266) +echo ========================================================================================================== +cd $PRODUCT_SOURCE_DIR/examples/$1 +arduino-cli compile --fqbn "esp8266:esp8266:nodemcuv2" "$1.ino" +echo +echo + +echo ========================================================================================================== +echo Compiling $ARDUINO_INO_FILE (esp32) +echo ========================================================================================================== +cd $PRODUCT_SOURCE_DIR/examples/$1 +arduino-cli compile --fqbn "esp32:esp32:esp32" "$1.ino" +echo +echo cd "$(dirname "$0")" diff --git a/ci/windows/arduino_build_sketch.bat b/ci/windows/arduino_build_sketch.bat index bcbc2fd..f1feb4f 100644 --- a/ci/windows/arduino_build_sketch.bat +++ b/ci/windows/arduino_build_sketch.bat @@ -24,10 +24,30 @@ echo. set ARDUINO_INO_FILE=%PRODUCT_SOURCE_DIR%\examples\%~1\%~1.ino echo ========================================================================================================== -echo Compiling %ARDUINO_INO_FILE% +echo Compiling %ARDUINO_INO_FILE% (atmega328) echo ========================================================================================================== cd /d "%PRODUCT_SOURCE_DIR%\examples\%~1" -arduino-cli compile -b arduino:avr:nano:cpu=atmega328 %~1.ino +arduino-cli compile --fqbn "arduino:avr:nano:cpu=atmega328" %~1.ino if %errorlevel% neq 0 exit /b %errorlevel% +echo. +echo. + +echo ========================================================================================================== +echo Compiling %ARDUINO_INO_FILE% (esp8266) +echo ========================================================================================================== +cd /d "%PRODUCT_SOURCE_DIR%\examples\%~1" +arduino-cli compile --fqbn "esp8266:esp8266:nodemcuv2" %~1.ino +if %errorlevel% neq 0 exit /b %errorlevel% +echo. +echo. + +echo ========================================================================================================== +echo Compiling %ARDUINO_INO_FILE% (esp32) +echo ========================================================================================================== +cd /d "%PRODUCT_SOURCE_DIR%\examples\%~1" +arduino-cli compile --fqbn "esp32:esp32:esp32" %~1.ino +if %errorlevel% neq 0 exit /b %errorlevel% +echo. +echo. cd /d "%~dp0"