Code covered by the BSD License  

Highlights from
MPC555 Motor Control Function Blockset

MPC555 Motor Control Function Blockset

by

 

20 Mar 2006 (Updated )

Additional I/O blocks for MPC555 target - specifically targetting TPU functionality

tstMPC555_test_compile(buildfile)
function buildresults = tstMPC555_test_compile(buildfile)

% Get a path to the test build directory
[filePath, fileName] = fileparts( which('SMTest') );
buildpath = [filePath, filesep, 'build'];

% Take a copy of the local directory and move to the build directory
currentdirectory = pwd;
cd(buildpath);

buildresults = {'Title', 'Result'; ...
    '-----', '-----'};

% Define the list of buildfiles
buildfilelist = {'BLDCtest',...
    'PMATest',...
    'TSMTest4',...
    'COMMTest',...
    'PMMTest',...
    'SVMTest',...
    'ThreeSinTest',...
    'FQMTest',...
    'PSPTest',...
    'TSMTest',...
    'ITCTest',...
    'SMTest',...
    'TSMTest3'};

if nargin == 0
    % Run a test build on each file
    for buildfile = buildfilelist
        buildresults = i_build_model(buildfile{:}, buildresults);
    end
else
    % Run a test build on the file specified
    buildresults = i_build_model(buildfile, buildresults);
end

end

function buildresults = i_build_model(buildfile, buildresults)
% Open the test file
open(buildfile);

% Turn off the generation of the HTML report
set_param(buildfile, 'GenerateReport', 'off');
% Ensure that code is compiled
set_param(buildfile, 'GenCodeOnly', 'off');
% Optimize for debug
set_param(buildfile, 'MPC555_OPTIMIZATION_SWITCH', 'debug');
% Enable local block outputs - ensure that models correctly accommodate
% these
set_param(buildfile, 'LocalBlockOutputs', 'on');
% Enable inline parameters
set_param(buildfile, 'InlineParams', 'on');
% Ensure there is no action after build
set_param(buildfile, 'BuildAction', 'None');

try
    rtwbuild(buildfile);
    buildresults = [buildresults; {buildfile, 'PASS'}];
catch
    buildresults = [buildresults; {buildfile, 'FAIL'}];
end

bdclose(buildfile);

% Clean up the mess made
if exist([buildfile,'_mpc555rt'], 'dir')
    rmdir([buildfile,'_mpc555rt'],'s');
end
if exist([buildfile,'_ram_Data'],'dir')
    rmdir([buildfile,'_ram_Data'],'s');
end

for suffx = {'bin', 'elf', 'map', 'mcp', 's19'}
    if exist([buildfile,'_ram.', suffx{:}], 'file')
        delete([buildfile,'_ram.', suffx{:}]);
    end
end

end

Contact us