I've been running through the logic of clearing bits and I don't really understand it. Here is what I have so far, where TIMSK0
is a register and TO1E0
is the least significant bit inside TIMSK0
TIMSK0 &= ~(1<<TO1E0)
So I've been thinking about this logically and trying to understand rather than memorize. The above example in full notation would be:
TIMSK0 = TIMSK0 & ~(1<<TO1E0)
Assuming TIMSK0
is currently 0000 0001
then that means TO1E0 = 1
then the argument looks like ~(1<<1)
which implies shift 1 left by 1, which results in 0. But then not of 0 is 1 so then I am ANDing the register TIMSK0
with 1
0000 0001 & 1
which also results in the same value 0000 0001
, I am very sure I messed up somewhere in my logic.