I’m doing some timer stuff, and I dont understand this opperator… |=

Here’s what I’m seeing…

PIT_TCTRL0 = TIE;

PIT_TCTRL0 |= TEN;

nevermind the logic, but what does the opperator mean? What is the difference between = and |=

I’m doing some timer stuff, and I dont understand this opperator… |=

Here’s what I’m seeing…

PIT_TCTRL0 = TIE;

PIT_TCTRL0 |= TEN;

nevermind the logic, but what does the opperator mean? What is the difference between = and |=

A |= B is the same as A = A|B

You can use the same for all the other operators (+=, *=, /=, %=, you get the idea). It is just a shorthand, just as A++ is the same as A+=1 or A=A+1.