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

📄 delay.c

📁 CML CMX868 modem
💻 C
字号:
//---------------------------------------------------------------------------------------------------
//	Project:-	DE8681
//  	Filename:-	DELAY.C
//	Description:-	Delay functions
//			Make sure this code is compiled with full optimization!!!
//	Programmer:-	D.T.F	
//	Version:-	2.0
//	Created:-	28th February 2002
//	Last modified:- 
//---------------------------------------------------------------------------------------------------
//	(C) Consumer Microcircuits Ltd 2002
//
//	This firmware was designed by:-
//			Consumer Microcircuits Ltd,
//			Langford, Maldon,
//			ESSEX
//			CM9 6WG.
//	in the UK for use with CML evaluation kits only and is based on UK originated technology.
//	Please contact
//			sales@cmlmicro.co.uk
//			+44 (0)1621 875500
//	for licensing details.
//---------------------------------------------------------------------------------------------------

#include	"ef8681.h"

void DelayMs(unsigned char cnt)
{
#if	XTAL_FREQ <= 2MHZ

	if (cnt == 0)
	{
		return;
	}

	do {
		DelayUs(996);
	} while(--cnt);
#endif

#if    XTAL_FREQ > 2MHZ	
	unsigned char	i;

	if (cnt == 0)
	{
		return;
	}

	do {
		i = 4;
		do {
			DelayUs(250);
		} while(--i);
	} while(--cnt);
#endif
}

void Delay1s(unsigned char cnt)
{
	unsigned char	i;

	if (cnt == 0)
	{
		return;
	}

	do {
		i = 4;
		do {
			DelayMs(250);
		} while(--i);
	} while(--cnt);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -