@echo off setlocal enabledelayedexpansion echo ===== CubeMX After Code Generation ===== set PROJECT_DIR=%~dp0.. cd /d "%PROJECT_DIR%" echo Project dir: %CD% set DST_DIR=Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM4F set BACKUP_DIR=tools\cubemx_temp_backup\FreeRTOS_RVDS_ARM_CM4F if not exist "%BACKUP_DIR%" ( echo ERROR: Backup dir not found: %BACKUP_DIR% exit /b 1 ) if not exist "%DST_DIR%" ( echo Destination dir not found, creating: echo %DST_DIR% mkdir "%DST_DIR%" ) echo Restore from: echo %BACKUP_DIR% echo To: echo %DST_DIR% if exist "%BACKUP_DIR%\port.c" ( copy /Y "%BACKUP_DIR%\port.c" "%DST_DIR%\port.c" ) if exist "%BACKUP_DIR%\portmacro.h" ( copy /Y "%BACKUP_DIR%\portmacro.h" "%DST_DIR%\portmacro.h" ) if exist "%BACKUP_DIR%\port.h" ( copy /Y "%BACKUP_DIR%\port.h" "%DST_DIR%\port.h" ) if exist "%BACKUP_DIR%\portasm.s" ( copy /Y "%BACKUP_DIR%\portasm.s" "%DST_DIR%\portasm.s" ) echo Restore finished. exit /b 0