📄 hal_wait.c
字号:
/*******************************************************************************************************
* *
* ********** *
* ************ *
* *** *** *
* *** +++ *** *
* *** + + *** *
* *** + CHIPCON HARDWARE ABSTRACTION LIBRARY FOR THE CC2420 *
* *** + + *** Idle looping *
* *** +++ *** *
* *** *** *
* ************ *
* ********** *
* *
*******************************************************************************************************
* The Chipcon Hardware Abstraction Library is a collection of functions, macros and constants, which *
* can be used to ease access to the hardware on the CC2420 and the target microcontroller. *
* *
* This function contains a function for idle looping with millisecond resolution. *
*******************************************************************************************************
* Compiler: AVR-GCC *
* Target platform: CC2420DB, CC2420 + any ATMEGA MCU *
*******************************************************************************************************
* Revision history: *
* $Log: hal_wait.c,v $
* Revision 1.2 2004/03/30 14:59:50 mbr
* Release for web
*
*
*
*******************************************************************************************************/
#include <include.h>
//-------------------------------------------------------------------------------------------------------
// void halWait(UINT16 timeout)
//
// DESCRIPTION:
// Runs an idle loop for [timeout] microseconds.
//
// ARGUMENTS:
// UINT16 timeout
// The timeout in microseconds
//-------------------------------------------------------------------------------------------------------
void halWait(UINT16 timeout) {
// This sequence uses exactly 8 clock cycles for each round
do {
_NOP();
} while (--timeout);
} // halWait
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -