unsigned char bytereverse(unsigned char val) {
int i;
for(i = 0; i < 4; i++) {
if(((val &(1 << i)) >> i)^((val & (1 << (7 - i))) >> (7 - i)))
val ^= (1 << i) | (1 << (7 - i));
}
return val;
}
时间: 2024-10-21 05:29:47