@echo off set defines=-D"ML" -D"__IQMATHLIB_H_INCLUDED__" -D"_MATLAB_SIMULATOR"^ -D"_MATLAB_FAST_SIMULATOR" -D"PROJECT_SHIP=1" :: -------------------------USERS PATHS AND CODE--------------------------- set includes_USER=-I"..\device_support_ml\include"^ -I".\"^ -I".\Inu"^ -I".\Inu\tms_matlab\"^ -I".\Inu\main_matlab"^ -I".\Inu\Src\main"^ -I".\Inu\Src\N12_VectorControl"^ -I".\Inu\Src\N12_Libs"^ -I".\Inu\Src\N12_Xilinx" :: исходный код set params_main_c=.\Inu\Src\main\adc_tools.c^ .\Inu\Src\main\v_pwm24_v2.c^ .\Inu\Src\main\calc_rms_vals.c^ .\Inu\Src\main\alg_simple_scalar.c^ .\Inu\Src\main\control_station_project.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\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_Libs\modbus_table_v2.c^ .\Inu\Src\N12_Xilinx\xp_write_xpwm_time.c set params_device_support=..\device_support_ml\source\C28x_FPU_FastRTS.obj^ ..\device_support_ml\source\DSP2833x_GlobalVariableDefs.obj^ ..\device_support_ml\source\IQmathLib_matlab.c set code_USER=%params_main_c% %params_vectorcontorl_c% %params_libs_c% %params_device_support% ::------------------------------------------------------------------------- :: -------------------------WRAPPER PATHS AND CODE--------------------------- :: оболочка, которая будет моделировать работу МК в симулинке set includes_WRAPPER= -I".\Inu" set code_WRAPPER= .\Inu\MCU.c^ .\Inu\mcu_wrapper.c^ .\Inu\main_matlab\pwm_sim.c^ .\Inu\main_matlab\init28335.c^ .\Inu\main_matlab\param.c^ .\Inu\main_matlab\main_matlab.c ::------------------------------------------------------------------------- :: ---------------------SET PARAMS FOR MEX COMPILING----------------------- :: --------ALL INCLUDES-------- set includes= %includes_USER% %includes_WRAPPER% set codes= %code_WRAPPER% %code_USER% :: -------OUTPUT FOLDER-------- set output= -outdir "." -output wrapper_inu :: если нужен дебаг, до запускаем run_mex с припиской debug IF [%1]==[debug] (set debug= -g) ::------------------------------------------------------------------------- ::------START COMPILING------- echo mex %output% %defines% %includes% %codes% %debug% echo Compiling... mex %output% %defines% %includes% %codes% %debug%