From b30695c8b29227d4de4624940982d94899e8a348 Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Sat, 1 Feb 2014 22:08:40 +0100 Subject: [PATCH] firmware: make sure PWM output pin is zero before suspend --- firmware/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/main.c b/firmware/main.c index 76bed47..4ac8171 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -179,6 +179,7 @@ static void pwm_init() power_timer1_enable(); DDRB |= _BV(PB4); + PORTB &= ~_BV(PB4); // TCCR1 = _BV(CS10); // clk/1 = 1 MHz TCCR1 = _BV(CS11) | _BV(CS13); // clk/512 = 2 kHz @@ -192,6 +193,9 @@ static void pwm_init() static void pwm_susp() { TCCR1 = 0; + TIMSK = 0; + GTCCR = 0; + PORTB &= ~_BV(PB4); } ISR(TIM1_OVF_vect) -- 2.43.5