common.c
来自「MSP4250单芯片电子称,采样数据无线发送给主机,编译环境IAR for MS」· C语言 代码 · 共 79 行
C
79 行
/*
*********************************************************************************************************
*
* File : COMMON.C
* Data : April 12, 2007
*********************************************************************************************************
*/
#include "hal.h"
/*
*********************************************************************************************************
* PAUSE_10US
*
* Description :
* Arguments :
* Returned Values : none
* Note(s)/Warnings :
*********************************************************************************************************
*/
void Pause_10uS(unsigned int delay)
{
#ifdef SYSCLOCK_512K
do{
__no_operation();
__no_operation();
}while(--delay);
#else
#ifdef SYSCLOCK_1M
do{
__no_operation();
__no_operation();
__no_operation();
__no_operation();
__no_operation();
__no_operation();
__no_operation();
}while(--delay);
#else
#ifdef SYSCLOCK_2M
char i;
do{
for(i=2;i;i--)
__no_operation();
}while(--delay);
#else
#ifdef SYSCLOCK_4M
char i;
do{
for(i=4;i;i--)
__no_operation();
}while(--delay);
#else
#error "SYSCLOCK_xx has not been defined"
#endif
#endif
#endif
#endif
}
/*
*********************************************************************************************************
* PAUSE_1MS
*
* Description :
* Arguments :
* Returned Values : none
* Note(s)/Warnings :
*********************************************************************************************************
*/
void Pause_1mS(unsigned int delay)
{
do{
Pause_10uS(100);
}while(--delay);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?