您好:
当我通过 CCS9.2在 F280049上调试程序时、我发现在 function1、function2中、不能执行 return 语句、但可以在 function3和 function4中执行。 您能帮我检查这两个函数之间是否有任何差异吗?
function1:
static Uint16 PfcHeartCounter(Uint16 CountType,Uint16 uCount)
{
if(CountType == 0)
{
uCount = IncreaseCounter(uCount);
}
else
{
uCount = DecreaseCounter(uCount);
}
return uCount;
}
function2:
static Uint16 IncreaseCounter(Uint16 Count)
{
Count = (Count+1u)&0xFFu;
return Count;
}
function3:
static Uint16 PfcHeartCounter(Uint16 CountType,Uint16 uCount)
{
if(CountType == 0)
{
uCount = IncreaseCounter(uCount);
return uCount;
}
else
{
uCount = DecreaseCounter(uCount);
return uCount;
}
}
function4:
static Uint16 IncreaseCounter(Uint16 Count)
{
Count++;
if(Count>255)
{
Count = 0;
}
return Count;
}