1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Lowering timer 1 prescale factor (to 8 from 64) for F_CPU less than 8 MHz.

Otherwise, you can see flicker on an LED.
This commit is contained in:
David A. Mellis 2011-10-21 11:54:11 -04:00
parent f684321850
commit ec09ead6ac

View File

@ -221,10 +221,14 @@ void init()
// set timer 1 prescale factor to 64
sbi(TCCR1B, CS11);
#if F_CPU >= 8000000L
sbi(TCCR1B, CS10);
#endif
#elif defined(TCCR1) && defined(CS11) && defined(CS10)
sbi(TCCR1, CS11);
#if F_CPU >= 8000000L
sbi(TCCR1, CS10);
#endif
#endif
// put timer 1 in 8-bit phase correct pwm mode
#if defined(TCCR1A) && defined(WGM10)