⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delay.#2

📁 本程序是基于单片机C8051F020上使用SL811 USB 总线接口实现检测U 盘的功能。插上U 盘
💻 #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 + -