From: Jan "Yenya" Kasprzak Date: Sun, 30 Sep 2012 19:57:05 +0000 (+0200) Subject: pwm: suspend function X-Git-Tag: gerber-fab-20121029-1711~33 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=f3abe581773fcb180cc8d882cfb5932f3bcccd4d;p=bike-lights.git pwm: suspend function --- diff --git a/firmware/pwm.c b/firmware/pwm.c index 10c03ba..98ab61f 100644 --- a/firmware/pwm.c +++ b/firmware/pwm.c @@ -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) {