hal_wait.c

来自「RF tranceiver MSP430F1611+CC2420 with Fr」· C语言 代码 · 共 54 行

C
54
字号
/*******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***                                                                                *
 *      ***   +                        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 MCU                                                         *
 *******************************************************************************************************
 * Revision history:                                                                                   *
 *                                                                                                     *
 *                                                                                                     *
 *                                                                                                     *
 *******************************************************************************************************/
#include "..\include\rfcom.h"
#include "..\..\..\Os\include\FreeRTOS.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
    {
        __no_operation();
    }
    while (--timeout);

} // halWait

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?