S
s
If I have:
unsigned char value = 0xBD;
unsigned char 2bits = 0x02;
How do I set the two MSB in value to the two LSB in 2bits without
changing any other bits in value?
<mytry>
value &= 0x3F; //set those two bits to zero
value |= (2bits<<6);
</mytry>
Do I have to clear(or set) those two bits first?
unsigned char value = 0xBD;
unsigned char 2bits = 0x02;
How do I set the two MSB in value to the two LSB in 2bits without
changing any other bits in value?
<mytry>
value &= 0x3F; //set those two bits to zero
value |= (2bits<<6);
</mytry>
Do I have to clear(or set) those two bits first?