主题:新手求教
void TxD8Hex(uint8_t bSentData)//用字符格式向pc发送一个16进制的数
{
uint8_t bTmp;
bTmp =((uint8_t)(bSentData>>4)&0x0f) + (uint8_t)'0';
if(bTmp > '9') bTmp += 7;
TxD8(bTmp);//#define TxD8 TxD81 用uart1向pc发送数据
bTmp =(uint8_t)(bSentData & 0x0f) + (uint8_t)'0'; //'0'=b0110000
if(bTmp > '9') bTmp += 7; //'9'=0111001
TxD8(bTmp);
}
求高手解读下这个程序,并且说下 bTmp +=7 是什么意思
{
uint8_t bTmp;
bTmp =((uint8_t)(bSentData>>4)&0x0f) + (uint8_t)'0';
if(bTmp > '9') bTmp += 7;
TxD8(bTmp);//#define TxD8 TxD81 用uart1向pc发送数据
bTmp =(uint8_t)(bSentData & 0x0f) + (uint8_t)'0'; //'0'=b0110000
if(bTmp > '9') bTmp += 7; //'9'=0111001
TxD8(bTmp);
}
求高手解读下这个程序,并且说下 bTmp +=7 是什么意思