remex.m

来自「simulink real-time workshop for dragon12」· M 代码 · 共 34 行

M
34
字号
% Recompile the communication module 'ext_comm'
%
% (FW-01-03)

function ReMex

clear all;

current_path = cd;
install_path = which('ReComp.m');
install_path = [install_path(1:max(find(install_path == '\'))-4)];
mex_path = [install_path 'rtw\ext_mode'];
include_path = ['"' install_path 'rtw\c\src' '"'];
instDLL_path = [install_path 'bin'];

cd (mex_path);

% compile 'ext_comm'
disp (['Compiling file ''ext_comm.c'' into a DLL.']);
eval(['mex ext_comm.c -v ext_convert.c ext_transport232.c -I' include_path])

% install 'ext_comm.dll'
olddll = [instDLL_path '\ext_comm_mc9S12.dll'];
if(size(dir(olddll), 1))
    disp (['Removing outdated file ' olddll]);
    eval(['!del ' '"' olddll '"']);
end

disp (['Copying file ''ext_comm.dll'' to the required system folder...']);
eval(['!copy ext_comm.dll ' '"' instDLL_path '\ext_comm_mc9S12.dll' '"'])

cd(current_path);
disp ('Done !');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?