在用C28346做for循环操作时,觉得花费的时间有些多:
for(pll=0;pll<8;pll++)
{
tpll=udclevel_sz[pll];
turn[tpll]=(7-pll);
turn_en[tpll]=turn[tpll]>>2;
turn_led[tpll]=turn[tpll]&0x03;
if((interrupt_count==2)&&(pll==0))
{
turn_led[tpll]=0;
}
turnen=(turn_en[tpll]<<tpll)|turnen;
turnon=(turn_led[tpll]<<(2*tpll))|turnon;
}
for(pll=0;pll<16;pll++)
{
if(fudc_ave_sz[pll]!=fudc_sz[pll])
{
error_count++;
}
}
if(error_count>0)
{
GPOC_NFPGAEN=1;
}
else
{
GPOS_NFPGAEN=1;
}
上述两个for循环操作共用去将近3.6μs的时间,请问这么点时间正常吗?更改CCS的设置是否可以使编译得到优化?
注:其中只有fudc_ave_sz和fudc_sz两个数组为浮点数组,其余变量均为16位整型数。