/*------------------------------------------------*/
/*函数名:ASCII转HEX */
/*参 数: bChar */
/*返回值: */
/*------------------------------------------------*/
uint8_t CharToHex(uint8_t bChar)
{
u8 temp;
temp = bChar;
if ((temp >= 0x30) && (temp <= 0x39))
{
temp -= 0x30;
}
else if ((temp >= 0x41) && (temp <= 0x46)) // Capital //大写
{
temp -= 0x37;
}
else if ((temp >= 0x61) && (temp <= 0x66)) //littlecase
{
temp -= 0x57;
}
else
{
temp = 0xff;
}
return temp;
}