delay.c
资源名称:de8681_w.rar [点击查看]
上传用户:lilishw
上传日期:2021-05-28
资源大小:1542k
文件大小:2k
源码类别:
Modem编程
开发平台:
Visual 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);
- }