Files
templates/tools/firmware-build/ccs/precompile.bat
T
Andrey d057df7698 Добавить прошивку F28335 через SCI и подготовку Python
Подключить сборку Flash BIN и RAM-ядра TI через templates.
Передавать настройки CAN и RS из JSON и проверять окружение CCS/Keil.
Добавить общий C99-протокол и проверки обмена SCI.
2026-11-13 17:02:33 +03:00

34 lines
1.7 KiB
Batchfile

@echo off
setlocal EnableExtensions DisableDelayedExpansion
if /i "%~1"=="--identity" goto identity
rem Legacy mode: build ID header only.
if "%~1"=="" goto usage
if "%~2"=="" goto usage
if not "%~3"=="" goto usage
if not exist "%~1\." (
echo [firmware-build] Project directory not found: "%~1" 1>&2
exit /b 2
)
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0..\..\..\c\firmware-info\tools\make_build_id.ps1" -Repository "%~f1" -Output "%~f2"
exit /b %errorlevel%
:identity
if "%~2"=="" goto usage
if "%~3"=="" goto usage
if "%~4"=="" goto usage
if not "%~5"=="" goto usage
rem Create the editable project configuration once; never overwrite user settings.
if not exist "%~f3" (
copy /Y "%~dp0firmware_identity.example.json" "%~f3" >nul
if errorlevel 1 exit /b 2
echo [firmware-build] Created configuration: "%~f3"
echo [firmware-build] Edit product, target and version in this file, then rebuild.
)
rem Общая подготовка и проверка выполняются в templates; сетевую публикацию выполняет Публикатор SETGUI.
rem Общая обвязка находит Python 3.8+ или готовит локальный runtime до резервирования номера сборки.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0..\python-runtime.ps1" "%~dp0..\..\..\c\firmware-info\tools\c2000_build.py" prepare --project "%~f2" --templates "%~dp0..\..\.." --config "%~f3" --output "%~f4"
exit /b %errorlevel%
:usage
echo Usage: precompile.bat --identity "project-root" "firmware_identity.json" "generated-dir" 1>&2
echo Legacy: precompile.bat "project-root" "output-header" 1>&2
exit /b 2