📄 delay.c
字号:
/*C**************************************************************************
* NAME: scheduler.c
*----------------------------------------------------------------------------
* Copyright (c) 2006 Atmel.
*----------------------------------------------------------------------------
* RELEASE: C51 Sample
* REVISION: 1.00
*----------------------------------------------------------------------------
*
*****************************************************************************/
#include "system\reg51.h"
#include "system\compiler.h"
#include "system\config.h"
#include "scheduler.h" /* scheduler definition */
/*F**************************************************************************
* NAME: DelayX1ms
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
* Keyboard task
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void DelayX1ms(Byte count)
{
Byte i,j;
for(i=0;i<count;i++)
for(j=0;j<120;j++)
;
}
/*F**************************************************************************
* NAME: DelayX1ms
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
* Keyboard task
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void DelayX10ms(Byte count)
{
Byte i,j,k;
for(i=0;i<count;i++)
for(j=0;j<10;j++)
for(k=0;k<120;k++)
;
}
/*F**************************************************************************
* NAME: DelayX25us
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
* Keyboard task
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void DelayX25us(Byte count)
{
Byte i,j;
for(i=0;i<count;i++)
for(j=0;j<3;j++)
;
}
/*
// ***********************************************************************
// Function : Delay100us
// Description : delay 100 us each time is called
// can be modified for different CPU speed
// ***********************************************************************
#pragma NOAREGS
void Delay100us(void)
{
BYTE data c;
#ifdef CPU_40M
c = 56; // T~=100uS for 40.5MHZ CPU
#else
#endif
while (c-- != 0);
} */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -