📄 delay.#2
字号:
#include <c8051F020.h>
//#include <intrins.h>
#include <delay.h>
#include "common.h"
//------------------------------------------------------------------------------------
// Delay function
//------------------------------------------------------------------------------------
void Delay_us(unsigned char Times)
{
unsigned char i;
for (i=0; i<Times; i++)
{
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();
}
}
void Delay_ms(unsigned char Times)
{
unsigned char i;
for (i=0; i<Times; i++)
{
Delay_us(250);
Delay_us(250);
Delay_us(250);
Delay_us(250);
//WDT_CLR;
}
}
void Delay_s(unsigned char Times)
{
unsigned char i;
for (i=0; i<Times; i++)
{ Delay_ms(250);
Delay_ms(250);
Delay_ms(250);
Delay_ms(250);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -