https://www.fi.muni.cz/~kas/git
/
heater.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d3b9a34
)
firmware: make sure PWM output pin is zero before suspend
author
Jan "Yenya" Kasprzak
<kas@fi.muni.cz>
Sat, 1 Feb 2014 21:08:40 +0000
(22:08 +0100)
committer
Jan "Yenya" Kasprzak
<kas@fi.muni.cz>
Sat, 1 Feb 2014 21:08:40 +0000
(22:08 +0100)
firmware/main.c
patch
|
blob
|
history
diff --git
a/firmware/main.c
b/firmware/main.c
index
76bed47
..
4ac8171
100644
(file)
--- 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)