?? general.c.bak
字號:
/****************************************************************************
Filename: general.c
programmer: zhang chen
Description: 通用子程序庫
內(nèi)容:
DelayMs:延時程序
ToBCD:將一個整數(shù)轉換為BCD碼
版本變更:
2003年10月11日 1.0
*****************************************************************************/
#include "general.h"
/**************************************************************************
延時
ms:延時的毫秒數(shù)
***************************************************************************/
void DelayMs(unsigned int ms)
{
unsigned int iq0, iq1;
for (iq0 = ms; iq0 > 0; iq0--)
for (iq1 = LOOPCNT; iq1 > 0; iq1--)
;
}
/**************************************************************************
將一個無符號整數(shù)轉換為BCD碼
shu:要轉換的無符號整數(shù)
pdst:指向轉化完成后保存的數(shù)組的首地址,*pdest放最高位, *(pdest+3)放最低位
***************************************************************************/
void ToBCD(unsigned char shu,unsigned char *pdest)
{
unsigned int iq1;
*pdest=shu/1000;
iq1=shu%1000;
pdest++;
*pdest=iq1/100;
iq1=iq1%100;
pdest++;
*pdest=iq1/10;
pdest++;
*pdest=iq1%10;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -