用宏实现HEX到ASCII ,ASCII 到HEX
#define HEX2ASCII(value, data) do{ \ value = (value > 0x09)?(value+0x7):value; \ *data = value + 0x30; \ }while(0)
#define ASCII2HEX(value, data) do{ \ value = *data; \ value = (value > 0x40)?(value - 0x7):value; \ }while(0)