]> www.fi.muni.cz Git - bike-lights.git/commitdiff
pwm: suspend function
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sun, 30 Sep 2012 19:57:05 +0000 (21:57 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sun, 30 Sep 2012 19:57:05 +0000 (21:57 +0200)
firmware/pwm.c

index 10c03ba700677a9141ad165ef761357a64f0d3d1..98ab61ff49013b3b19d95b272f9cd97910581595 100644 (file)
@@ -37,6 +37,14 @@ void init_pwm()
        PORTB &= ~(_BV( PB1 ) | _BV( PB3 ) | _BV( PB5 )); // set to zero
 }
 
+void susp_pwm()
+{
+       DDRB &= ~(_BV( PB1 ) | _BV( PB3 ) | _BV( PB5 ));
+       TCCR1D = TCCR1C = TCCR1B = TCCR1A = 0;
+       TIMSK = 0;
+       TIFR = 0;
+}
+
 void pwm_off(unsigned char n)
 {
        switch (n) {