]> www.fi.muni.cz Git - tinyboard.git/blobdiff - projects/step-up/pwm.c
Power management - make every module enable power for its own HW.
[tinyboard.git] / projects / step-up / pwm.c
index f16aaa3175440cd44b84abafb3b477baa5d74e31..18a14253552a7c7628f1dc9dde24e1512af83437 100644 (file)
@@ -1,5 +1,6 @@
 #include <avr/io.h>
 #include <avr/interrupt.h>
 #include <avr/io.h>
 #include <avr/interrupt.h>
+#include <avr/power.h>
 #include <util/delay.h>
 #include <util/atomic.h>
 
 #include <util/delay.h>
 #include <util/atomic.h>
 
@@ -24,6 +25,8 @@ static void inline enable_pll()
 
 void init_pwm()
 {
 
 void init_pwm()
 {
+       power_timer1_enable();
+
        enable_pll();
 
        TCCR1 = _BV(CTC1) | _BV(CS10);  // no clock prescaling
        enable_pll();
 
        TCCR1 = _BV(CTC1) | _BV(CS10);  // no clock prescaling