gusucode.com > target工具箱matlab源码程序 > target/extensions/processor/shared/ti/mdlinfo/getBlockInfo_CPUTimer_C2000.m
function [linkPjtGenInfo, schedPjtGenInfo, targetInfo] = getBlockInfo_CPUTimer_C2000(linkPjtGenInfo, schedPjtGenInfo, targetInfo) %GETBLOCKINFO_CPUTIMER Get information about a CPU Timer block. % Copyright 2007-2010 The MathWorks, Inc. %---------------------------------------------------------- % Look for CPU Timer blocks in the model %---------------------------------------------------------- timerBlock = linkfoundation.util.FindSystem(linkPjtGenInfo.modelName,'C281x EV Timer'); %---------------------------------------------------------- % Update 'schedPjtGenInfo' if a CPU Timer block is present %---------------------------------------------------------- % linkPjtGenInfo.numTimers - (Increment) Number of interrupts in the model % linkPjtGenInfo.timerModule - Timer module (A=1, B=2) % linkPjtGenInfo.timerNumber - Timer number %---------------------------------------------------------- for i=1:length(timerBlock) % Increment number of timers by 1 linkPjtGenInfo.numTimers = linkPjtGenInfo.numTimers + 1; % Process selected module module = get_param (timerBlock(i), 'module'); % 1:ModuleA, 2:ModuleB if strcmpi(module,'A'), linkPjtGenInfo.timerModule{i}=1; else linkPjtGenInfo.timerModule{i}=2; end % Module A: use 'timerAno' % Module B: use 'timerBno' if linkPjtGenInfo.timerModule{i}==1, param='timerAno'; else param='timerBno'; end tnum = get_param (timerBlock(i), param); linkPjtGenInfo.timerNumber{i} = str2num(cell2mat(strrep(tnum,'Timer ',''))); end %[EOF] getBlockInfo_CPUTimer_C2000.m