forked from gronod/squeezelite-esp32
81 lines
1.7 KiB
Batchfile
81 lines
1.7 KiB
Batchfile
@echo off
|
|
REM Build script for Guition JC4827W543C board - Batch file version
|
|
REM Usage: build-guition.bat [clean]
|
|
|
|
echo Building Squeezelite-ESP32 for Guition JC4827W543C
|
|
|
|
REM Check if ESP-IDF environment is set up
|
|
if "%IDF_PATH%"=="" (
|
|
echo Error: ESP-IDF environment not found!
|
|
echo Please run esp-idf\export.bat first
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM Set target to ESP32-S3
|
|
set IDF_TARGET=esp32s3
|
|
echo Target set to: %IDF_TARGET%
|
|
|
|
REM Copy Guition-specific configuration
|
|
if exist "squeezelite-esp32-Guition-sdkconfig.defaults" (
|
|
echo Using Guition configuration...
|
|
copy /Y "squeezelite-esp32-Guition-sdkconfig.defaults" "sdkconfig.defaults"
|
|
) else (
|
|
echo Warning: Guition configuration file not found
|
|
)
|
|
|
|
REM Clean if requested
|
|
if /i "%1"=="clean" (
|
|
echo Cleaning build...
|
|
idf.py fullclean
|
|
if errorlevel 1 (
|
|
echo Clean failed!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
)
|
|
|
|
REM Configure the project
|
|
echo Configuring project...
|
|
echo Running: idf.py menuconfig
|
|
echo Select: Squeezelite-ESP32 -^> Guition JC4827W543C
|
|
echo.
|
|
echo Press any key to continue to menuconfig...
|
|
pause > nul
|
|
|
|
idf.py menuconfig
|
|
if errorlevel 1 (
|
|
echo Configuration failed!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM Build the project
|
|
echo Building firmware...
|
|
idf.py build
|
|
if errorlevel 1 (
|
|
echo Build failed!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Build complete!
|
|
echo Firmware location: build\squeezelite.bin
|
|
echo.
|
|
echo To flash the firmware:
|
|
echo idf.py -p ^<PORT^> flash
|
|
echo.
|
|
echo To monitor output:
|
|
echo idf.py -p ^<PORT^> monitor
|
|
|
|
REM Ask if user wants to flash
|
|
echo.
|
|
set /p flash="Do you want to flash the firmware now? (y/n) "
|
|
if /i "%flash%"=="y" (
|
|
set /p port="Enter COM port (e.g., COM3): "
|
|
echo Flashing to %port%...
|
|
idf.py -p %port% flash monitor
|
|
)
|
|
|
|
pause
|