@echo off


IF [%1]==[] (set params_sfunction=.\Inu\wrapper_inu_1.c)
IF NOT [%1]==[] (set params_sfunction=.\Inu\%1)

echo %params_sfunction%

set params_d1=-D"ML" -D"__IQMATHLIB_H_INCLUDED__" -D"_MATLAB_SIMULATOR"
set params_d2=-D"_MATLAB_FAST_SIMULATOR" -D"PROJECT_SHIP=1"

set params_i=-I"..\device_support_ml\include"^
 -I"."^
 -I".\Inu"^
 -I".\Inu\Src\main"^
 -I".\Inu\Src\N12_VectorControl"^
 -I".\Inu\Src\main_matlab"^
 -I".\Inu\Src\N12_Libs"^
 -I".\Inu\Src\N12_Xilinx"

set params_o=-outdir "."

set params_wrapper_c=.\Inu\controller.c^
 .\Inu\pwm_sim.c^
 .\Inu\Src\main_matlab\init28335.c^
 .\Inu\Src\main_matlab\param.c^
 .\Inu\Src\main_matlab\main_matlab.c^
 .\Inu\Src\main_matlab\IQmathLib_matlab.c

set params_vectorcontorl_c=.\Inu\Src\N12_VectorControl\vector_control.c^
 .\Inu\Src\N12_VectorControl\teta_calc.c^
 .\Inu\Src\N12_VectorControl\regul_power.c^
 .\Inu\Src\N12_VectorControl\regul_turns.c^
 .\Inu\Src\N12_VectorControl\abc_to_dq.c^
 .\Inu\Src\N12_VectorControl\dq_to_alphabeta_cos.c^
 .\Inu\Src\N12_VectorControl\alphabeta_to_dq.c^
 .\Inu\Src\N12_VectorControl\abc_to_alphabeta.c^
 .\Inu\Src\N12_VectorControl\alg_pll.c


set params_libs_c=.\Inu\Src\N12_Libs\mathlib.c^
 .\Inu\Src\N12_Libs\pid_reg3.c^
 .\Inu\Src\N12_Libs\rmp_cntl_v1.c^
 .\Inu\Src\N12_Libs\rmp_cntl_v2.c^
 .\Inu\Src\N12_Libs\filter_v1.c^
 .\Inu\Src\N12_Libs\uf_alg_ing.c^
 .\Inu\Src\N12_Libs\svgen_mf.c^
 .\Inu\Src\N12_Libs\svgen_dq_v2.c^
 .\Inu\Src\N12_Libs\control_station.c^
 .\Inu\Src\N12_Libs\global_time.c^
 .\Inu\Src\N12_Xilinx\xp_write_xpwm_time.c^
 .\Inu\Src\main\adc_tools.c^
 .\Inu\Src\main\v_pwm24_v2.c^
 .\Inu\Src\main\limit_power.c^
 .\Inu\Src\main\limit_lib.c^
 .\Inu\Src\main\pll_tools.c^
 .\Inu\Src\main\calc_rms_vals.c^
 .\Inu\Src\main\alg_simple_scalar.c^
 .\Inu\Src\main\control_station_project.c^
 .\Inu\Src\main\ramp_zadanie_tools.c

set params_obj=..\device_support_ml\source\C28x_FPU_FastRTS.obj ..\device_support_ml\source\DSP2833x_GlobalVariableDefs.obj



 
echo mex %params_d1% %params_d2% %params_i% %params_o% %params_sfunction% %params_wrapper_c% %params_vectorcontorl_c% %params_libs_c% %params_obj% -g


mex %params_d1% %params_d2% %params_i% %params_o% %params_sfunction% %params_wrapper_c% %params_vectorcontorl_c% %params_libs_c% %params_obj% -g
