📄 wait.c
字号:
/*****************************************************************************
* *
* ********** *
* ************ *
* *** *** *
* *** +++ *** *
* *** + + *** *
* *** + 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -