clear, clc
% Компилирует S-function
currFolder = cd;
%cd([currFolder, '\Inu']);

delete("wrapper_inu.mexw64")

status=system('run_mex.bat wrapper_inu.c')
if status==0
else
 error('Error!')
end

% status=system('run_mex.bat wrapper_inu_2.c')
% if status==0
% else
%  error('Error!')
% end

%mex -D"ML" -D"__IQMATHLIB_H_INCLUDED__" -D"_MATLAB_SIMULATOR" -I"..\device_support_ml\include" -I"." -I".\Inu" -I".\Inu\Src\main" -I".\Inu\Src\VectorControl" -I".\Inu\Src\main_matlab" -I".\Inu\Src\myLibs" -I".\Inu\Src\myXilinx" -outdir "." .\Inu\wrapper_inu_1.c .\Inu\controller.c .\Inu\init28335.c .\Inu\detcoeff.c .\Inu\isr.c .\Inu\main.c .\Inu\param.c .\Inu\upr.c .\Inu\Src\main_matlab\IQmathLib_matlab.c .\Inu\Src\main_matlab\main_matlab.c .\Inu\Src\main_matlab\adc_tools_matlab.c  .\Inu\Src\myLibs\modbus_read_table.c .\Inu\Src\myLibs\my_filter.c .\Inu\Src\myLibs\pid_reg3.c .\Inu\Src\myLibs\svgen_dq_v2.c .\Inu\Src\myLibs\rmp_cntl_my1.c .\Inu\Src\myLibs\modbus_table.c .\Inu\Src\myLibs\mathlib.c .\Inu\Src\main_matlab\v_pwm24_matlab.c .\Inu\Src\main_matlab\xp_write_xpwm_time_matlab.c .\Inu\Src\main_matlab\errors_matlab.c .\Inu\Src\main\detect_overload.c .\Inu\Src\main\rotation_speed.c .\Inu\Src\main\global_time.c .\Inu\Src\main\PWMTools.c .\Inu\Src\VectorControl\pwm_vector_regul.c .\Inu\Src\VectorControl\abc_to_dq.c .\Inu\Src\VectorControl\regul_power.c .\Inu\Src\VectorControl\regul_turns.c .\Inu\Src\VectorControl\teta_calc.c .\Inu\Src\VectorControl\dq_to_alphabeta_cos.c ..\device_support_ml\source\C28x_FPU_FastRTS.obj ..\device_support_ml\source\DSP2833x_GlobalVariableDefs.obj
%mex -D"ML" -D"__IQMATHLIB_H_INCLUDED__" -D"_MATLAB_SIMULATOR" -I"..\device_support_ml\include" -I"." -I".\Inu" -I".\Inu\Src\main" -I".\Inu\Src\VectorControl" -I".\Inu\Src\main_matlab" -I".\Inu\Src\myLibs" -I".\Inu\Src\myXilinx" -outdir "." .\Inu\wrapper_inu_2.c .\Inu\controller.c .\Inu\init28335.c .\Inu\detcoeff.c .\Inu\isr.c .\Inu\main.c .\Inu\param.c .\Inu\upr.c .\Inu\Src\main_matlab\IQmathLib_matlab.c .\Inu\Src\main_matlab\main_matlab.c .\Inu\Src\main_matlab\adc_tools_matlab.c  .\Inu\Src\myLibs\modbus_read_table.c .\Inu\Src\myLibs\my_filter.c .\Inu\Src\myLibs\pid_reg3.c .\Inu\Src\myLibs\svgen_dq_v2.c .\Inu\Src\myLibs\rmp_cntl_my1.c .\Inu\Src\myLibs\modbus_table.c .\Inu\Src\myLibs\mathlib.c .\Inu\Src\main_matlab\v_pwm24_matlab.c .\Inu\Src\main_matlab\xp_write_xpwm_time_matlab.c .\Inu\Src\main_matlab\errors_matlab.c .\Inu\Src\main\detect_overload.c .\Inu\Src\main\rotation_speed.c .\Inu\Src\main\global_time.c .\Inu\Src\main\PWMTools.c .\Inu\Src\VectorControl\pwm_vector_regul.c .\Inu\Src\VectorControl\abc_to_dq.c .\Inu\Src\VectorControl\regul_power.c .\Inu\Src\VectorControl\regul_turns.c .\Inu\Src\VectorControl\teta_calc.c .\Inu\Src\VectorControl\dq_to_alphabeta_cos.c ..\device_support_ml\source\C28x_FPU_FastRTS.obj ..\device_support_ml\source\DSP2833x_GlobalVariableDefs.obj


clear currFolder
