紀錄
SDK 常用函式與方法
int
to string : sprintf()
void
int2str(int
i, char
*s) {
sprintf(s,"%d",i);
}
|
int
to hex
u32
int_value;
char
hex_value[8];
int_value
= 291;
hex_value[0]
= (char)((int_value
>> 28) & 0xF);
hex_value[1]
= (char)((int_value
>> 24) & 0xF);
hex_value[2]
= (char)((int_value
>> 20) & 0xF);
hex_value[3]
= (char)((int_value
>> 16) & 0xF);
hex_value[4]
= (char)((int_value
>> 12) & 0xF);
hex_value[5]
= (char)((int_value
>> 8) & 0xF);
hex_value[6]
= (char)((int_value
>> 4) & 0xF);
hex_value[7]
= (char)((int_value)
& 0xF);
hex_value[8]
= '\n';
|
沒有留言:
張貼留言