From b4a9b392c57ca8b3f740dd3035b1f43b4ad583b4 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 12 Jul 2011 00:54:33 +0000 Subject: add clock, redesign timer, tweak stack values --- kernel/heartbeat.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'kernel/heartbeat.c') diff --git a/kernel/heartbeat.c b/kernel/heartbeat.c index 64f3182..b562d26 100644 --- a/kernel/heartbeat.c +++ b/kernel/heartbeat.c @@ -30,17 +30,19 @@ heartbeat(void *arg) DDRB |= _BV(PIN); PORTB &= ~_BV(PIN); + update(0, MSEC(750)); + for (;;) { - PORTB ^= _BV(PIN); - snooze(MSEC(100)); + PORTB |= _BV(PIN); + sleep(SOFT, MSEC(100)); - PORTB ^= _BV(PIN); - snooze(MSEC(50)); + PORTB &= ~_BV(PIN); + sleep(SOFT, MSEC(50)); - PORTB ^= _BV(PIN); - snooze(MSEC(100)); + PORTB |= _BV(PIN); + sleep(SOFT, MSEC(100)); - PORTB ^= _BV(PIN); - period(MSEC(750)); + PORTB &= ~_BV(PIN); + sleep(SOFT, MSEC(500)); } } -- cgit v1.2.3