-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBuildArduino.bat
More file actions
41 lines (34 loc) · 1.07 KB
/
BuildArduino.bat
File metadata and controls
41 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@echo off
rem Check if arduino-cli is available in PATH
where arduino-cli >nul 2>&1
if errorlevel 1 (
echo ERROR: 'arduino-cli' is not found in PATH. Please install it or add it to your PATH.
pause
exit /b 1
)
echo Building all Arduino firmwares
set SKETCH_DIR=%~dp0Arduino
set OUTPUT_DIR=%~dp0build
set DEPLOY_DIR=%~dp0Desktop\SharpManager.Common\Firmware
if not exist "%OUTPUT_DIR%" mkdir "%OUTPUT_DIR%"
rem Compile each board
call :compile "arduino:avr:leonardo" Leonardo.hex
call :compile "arduino:avr:mega" Mega2560.hex
call :compile "arduino:avr:micro" Micro.hex
call :compile "arduino:avr:nano" Nano.hex
call :compile "arduino:avr:uno" Uno.hex
echo Done.
pause
exit /b
:compile
echo Compiling for %~1 to %~2
echo arduino-cli compile --fqbn %1 --build-path "%OUTPUT_DIR%" "%SKETCH_DIR%"
arduino-cli compile --fqbn %1 --build-path "%OUTPUT_DIR%" "%SKETCH_DIR%"
if %errorlevel% neq 0 (
echo Failed to compile %1
) else (
copy /Y "%OUTPUT_DIR%\Arduino.ino.hex" "%DEPLOY_DIR%\%2" >nul
echo Success: %2
)
echo.
exit /b