summaryrefslogtreecommitdiff
path: root/usb-i2c-sl018/heartbeat.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-02-06 01:17:12 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-02-06 01:17:12 +0000
commit7ebd33cb40aa50f187d7eaa7e44ce3499a6a2a3b (patch)
treed767ba17ead755fefd0e68ffecdce2f7ed1e0dc7 /usb-i2c-sl018/heartbeat.c
parentadded open and close command (diff)
cleanup
git-svn-id: https://svn.spreadspace.org/avr/trunk@124 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'usb-i2c-sl018/heartbeat.c')
-rw-r--r--usb-i2c-sl018/heartbeat.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usb-i2c-sl018/heartbeat.c b/usb-i2c-sl018/heartbeat.c
index 6822320..fd9d5cb 100644
--- a/usb-i2c-sl018/heartbeat.c
+++ b/usb-i2c-sl018/heartbeat.c
@@ -50,13 +50,11 @@ void init_heartbeat(void)
heartbeat_cnt = 0;
heartbeat_flag = 1;
- // timer 2: ~10 ms, timebase for heartbeat signal
- TCCR0A = 1<<WGM01; // OC0A and OC0B as normal output, WGM = 2 (CTC)
- TCCR0B = 1<<CS02 | 1<<CS00; // Prescaler 1:1024
- OCR0A = 155; // (1+155)*1024 = 159744 -> ~10 ms @ 16 MHz
- //OCR2A = 194; // (1+194)*1024 = 199680 -> ~10 ms @ 20 MHz
- TCNT2 = 0; // reseting timer
- TIMSK0 = 1<<OCIE0A; // enable Interrupt
+ TCCR0A = 1<<WGM01; // OC0A and OC0B as normal output, WGM = 2 (CTC)
+ TCCR0B = 1<<CS02 | 1<<CS00; // Prescaler 1:1024
+ OCR0A = 155; // (1+155)*1024 = 159744 -> ~10 ms @ 16 MHz
+ TCNT2 = 0;
+ TIMSK0 = 1<<OCIE0A;
}
void handle_heartbeat(void)