Avr c++

Thread Starter

samjesse

Joined Sep 14, 2008
212
Hi

This line is taken from avrfreaks.net
TCCR1B |= (1 << CS10); // Set up timer
I read it as:
TCCR1B = TCCR1B | (1 << CS10); // Set up timer
Which is setting a bits in TCCR1B. Which bit is it setting?
I take it CS10 is the bit number. Is it a variable which has a value?
That is shifting a 1 by CS10 number of bits to the left, am I right?

Many Thx
 

tshuck

Joined Oct 18, 2012
3,534
CS10 is defined in the header file. It has a numeric value associated with it, so that the 1 is shifted by the value necessary to address the desired bit.
 
Top