📄 delaytime.c
字号:
#include <intrins.h>
#include "MyType.h"
#include "Delaytime.h"
/*=========================================================================
名称: void Delay1Ms(uchar t);
功能:延时1ms
参数:t,最大255
调用: 无
返回:无
=========================================================================*/
void Delay1Ms(uchar t)
{
uchar i;
for (;t>0;t--)
{
for (i=0;i<138;i++)
{
_nop_();_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();_nop_();
}
}
}
/*=========================================================================
名称: void Delay1s(uchar t);
功能:延时1s
参数:t,最大255
调用: Delay1Ms(uchar t);
返回:无
=========================================================================*/
void Delay1s(uchar t)
{
for (;t>0;t--)
{
Delay1Ms(250);
Delay1Ms(250);
Delay1Ms(250);
Delay1Ms(250);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -