gusucode.com > target工具箱matlab源码程序 > target/extensions/processor/tic2000/utils/calcADCModuleClockPrompt.m

    function newADCClockPrescalerPromptStr = calcADCModuleClockPrompt(ADCClockPrescaler, curADCClockPrescalerPromptStr)
%CALCADCMODULECLOCKPROMPT Summary of this function goes here
%   Detailed explanation goes here

if ischar(ADCClockPrescaler)
    ADCClockPrescaler = str2double(ADCClockPrescaler);
end

adclkps_divider_str = '\/\(ADCLKPS\*2\)\/';

if ADCClockPrescaler == 0
    newADCClockPrescalerPromptStr = regexprep(curADCClockPrescalerPromptStr, adclkps_divider_str, '\/');
else
    div_str_found = regexp(curADCClockPrescalerPromptStr, adclkps_divider_str, 'match');
    if isempty(div_str_found)
        newADCClockPrescalerPromptStr = regexprep(curADCClockPrescalerPromptStr, '\/', adclkps_divider_str);
    else
        newADCClockPrescalerPromptStr = curADCClockPrescalerPromptStr;
    end
end