Can anyone tell me the difference between the following two assignments?
control_reg |= (1<<2) | (1<<4);
control_reg = (1<<2) | (1<<4);
Can anyone tell me the difference between the following two assignments?
control_reg |= (1<<2) | (1<<4);
control_reg = (1<<2) | (1<<4);
control_reg |= (1<<2) | (1<<4);
This only affects bits 2 and 4 -- all of the other bits in control_reg are left unmodified.
control_reg = (1<<2) | (1<<4);
This modifies all the bits in control_reg -- bits 2 and 4 are set to 1 and all the other bits are set to 0.