#include <avr/io.h>
#include <avr/interrupt.h>
+#include <avr/power.h>
#include <util/delay.h>
#include <util/atomic.h>
void init_pwm()
{
+ power_timer1_enable();
+
enable_pll();
TCCR1 = _BV(CTC1) | _BV(CS10); // no clock prescaling
PORTB &= ~_BV(PB4); // set to zero
}
-#if 0
void susp_pwm()
{
- unsigned char i;
-
- for (i = 0; i < N_PWMLEDS; i++)
- pwm[i] = 0;
-
- DDRB &= ~(_BV( PB1 ) | _BV( PB3 ) | _BV( PB5 ));
- TCCR1D = TCCR1C = TCCR1B = TCCR1A = 0;
+ DDRB &= ~(_BV( PB4 ));
+ PORTB &= ~(_BV( PB4 ));
+ TCCR1 = 0;
TIMSK = 0;
TIFR = 0;
PLLCSR &= ~(_BV(PLLE) | _BV(PCKE));
}
-#endif
void pwm_off()
{