@ECHO OFF
rem merge_appl.bat
rem Copyright (c) 2012 Texas Instruments Incorporated ALL RIGHTS RESERVED

rem ******************************************************
rem This batch file merges three binary files  into one by  
rem calling isdk_merge utility
rem ******************************************************

rem setlocal enabledelayedexpansion
setlocal

set out_file="%CD%\Debug\ecat_appl_pru.bin"
set infile="%CD%\Debug\ecat_appl_SPI.bin"
set pru0_firware_name="%IA_SDK_HOME%\protocols\ethercat_slave\firmware\ecat_frame_handler_flash.bin"
set pru1_firware_name="%IA_SDK_HOME%\protocols\ethercat_slave\firmware\ecat_host_interface_flash.bin"
set pru0_offset="78000"
set pru1_offset="4000"

rem echo %out_file%
rem echo %infile%
rem echo %pru0_firware_name%
rem echo %pru1_firware_name%
rem echo %pru0_offset%
rem echo %pru1_offset%

%IA_SDK_HOME%\tools\isdk_merge\isdk_merge.exe %out_file% %infile% %pru0_offset% %pru0_firware_name% %pru1_offset% %pru1_firware_name%
    
    
:FINISH
        echo 