delays.c

来自「MSP430的SPI接口的例子程序。连接NRF24L01实现定长的数据包通信」· C语言 代码 · 共 36 行

C
36
字号
/*****************************************************************************
*
* File: delays.c
* 
* Copyright S. Brennen Ball, 2006-2007
* 
* The author provides no guarantees, warantees, or promises, implied or
*	otherwise.  By using this software you agree to indemnify the author
* 	of any damages incurred by using it.
* 
*****************************************************************************/

#include "delays.h"
//#include "lpc214x.h"

void DelayUS(unsigned int microseconds)
{
    int i = 0;
    microseconds = microseconds*5;
    while(i++ < microseconds);
}

void DelayMS(unsigned int milliseconds)
{		
    int i = 0;
    milliseconds*=8;
    while(i++ < milliseconds);
}

void DelayS(unsigned int seconds)
{
    int i = 0;
    seconds*=8;
    while(i++ < seconds);
}

⌨️ 快捷键说明

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