general.c
来自「LCD及键盘、RS232通信控制源代码、采用keil c51环境编译」· C语言 代码 · 共 61 行
C
61 行
/*********************************************************************************
* *
* FileName: General.c *
* Function: General function *
* SystemName: NDS18000-BSC *
* CPU: ATMEL AT89C52 *
* Startup: 14/Oct/2002 *
* Author: XuYiBo *
* *
*********************************************************************************/
#include <intrins.h>
#include "NDSBSCUI.H"
#include "General.h"
////////////////////////////////////////////////////////////////////////////////////
/***********************************************************
* *
* delay 8*ucDelayCycle CYCLE *
* *
***********************************************************/
void DelayCycle(unsigned char ucCycle)
{
for(;ucCycle!=0;ucCycle--)
{
_nop_();
_nop_();
}
}
/***********************************************************
* *
* delay ucTime(ms) *
* *
***********************************************************/
void DelayTime(unsigned char ucTime)
{
unsigned char ucTmp;
for(;ucTime!=0;ucTime--)
{
#ifdef SYSTEMCRYSTAL
#if SYSTEMCRYSTAL == 11059200
for(ucTmp=0;ucTmp<135;ucTmp++)
#elif SYSTEMCRYSTAL == 12000000
for(ucTmp=0;ucTmp<124;ucTmp++)
#elif SYSTEMCRYSTAL == 18432000
for(ucTmp=0;ucTmp<80;ucTmp++)
#endif
#else
for(ucTmp=0;ucTmp<135;ucTmp++)
#endif
{
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?