wait.c
来自「无线龙ZigBee模块CC1010的接收-发送程序。」· C语言 代码 · 共 55 行
C
55 行
/*****************************************************************************
* *
* ********** *
* ************ *
* *** *** *
* *** +++ *** *
* *** + + *** *
* *** + CHIPCON CC1010 *
* *** + + *** HAL - Wait *
* *** +++ *** *
* *** *** *
* *********** *
* ********* *
* *
*****************************************************************************
* *
*****************************************************************************
* Author: ROH *
*****************************************************************************
* Revision history: *
* *
* $Log: Wait.c,v $
* Revision 1.1 2002/10/14 13:04:37 tos
* Initial version in CVS.
*
* *
****************************************************************************/
#include <chipcon/hal.h>
//----------------------------------------------------------------------------
// byte* halWait(...)
//
// Description:
// A wait functions which performs a number of iterations of a simple
// wait loop, so that at least _timeOut_ ms goes by before the
// function returns.
//
// Arguments:
// byte timeOut
// The time to wait in ms.
// word clkFreq
// The XOSC clock frequency in kHz.
//
// Return value:
// void
//----------------------------------------------------------------------------
void halWait(byte timeOut, word clkFreq) {
ulong wait;
wait=(ulong)timeOut*(ulong)clkFreq/192;
while (wait--);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?