📄 hal_wait.c
字号:
/*******************************************************************************************************
* *
* ********** *
* ************ *
* *** *** *
* *** +++ *** *
* *** + + *** *
* *** + CHIPCON HARDWARE ABSTRACTION LIBRARY FOR THE CC2430 *
* *** + + *** Idle Looping *
* *** +++ *** *
* *** *** *
* ************ *
* ********** *
* *
*******************************************************************************************************
* Copyright Chipcon AS, 2005 *
*******************************************************************************************************
* 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 CC2430 and the target microcontroller. *
* *
* This file contains a function that implements idle looping, with a resolution of 1 msec. *
* *
* EXAMPLE OF USAGE: *
* // Wait for at least 50 milliseconds *
* halWait(50000); *
*******************************************************************************************************
*******************************************************************************************************/
#include <mac_headers.h>
//-------------------------------------------------------------------------------------------------------
// void halMacWait(UINT16 timeout)
//
// DESCRIPTION:
// Runs an idle loop for [timeout] microseconds.
// Note: The time spent in interruptions will be added to the timeout!
//
// ARGUMENTS:
// UINT16 timeout
// The timeout in microseconds
//-------------------------------------------------------------------------------------------------------
ROOT void halMacWait(UINT16 timeout) {
while (timeout--) {
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -