51ms级几种CPU延时
1,* 延时子程序 *
* *
******************************************************************************/
void delayms(unsigned char ms)
{
unsigned char i;
while(ms--)
{
for(i = 0; i < 120; i++);
}
}
*********************************************
2.
void delay(unsigned int i)
{
char j;
for(i; i > 0; i--)
for(j = 200; j > 0; j--);
}
3.
void delayms(uint xms)
{
uint i, j;
for(i=xms; i > 0; i--)
for(j = 120; j > 0; j--);
}
***************************************************************
4.
void delay11us(uint z)
{
uint a,b;
for(a=11;a>0;a--)
for(b=z;b>0;b--);
}
***************************************************************
5,
void delayms(int m)
{
int i,j;
for(i=0;i<m;i++)
{
for(j=0;j<12;j++)
{}
}
}
写于2012年年末
1029

被折叠的 条评论
为什么被折叠?



