大家好
请问以下这个函数的具体延时时间是多少
// Delay function. # of CPU cycles delayed is similar to "cycles". Specifically,
// it's ((cycles-15) % 6) + 15. Not exact, but gives a sense of the real-time
// delay. Also, if MCLK ~1MHz, "cycles" is similar to # of useconds delayed.
void TI_CC_Wait(unsigned int cycles)
{
while(cycles>15) // 15 cycles consumed by overhead
cycles = cycles - 6; // 6 cycles consumed each iteration
按照解释,好像是如果MCLK为1Mhz的话,那么这个函数延时((cycles-15) % 6) + 15) us
那么如果cycles=21或27,结果都是15us了,请问是不是这样的?