summaryrefslogtreecommitdiff
path: root/usb-i2c-sl018/heartbeat.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-02-07 02:15:37 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-02-07 02:15:37 +0000
commitc9daddb636b3c03b5c53da2ef8e11b927927dd04 (patch)
tree3833c802143d0515871fb41146b8317533987f44 /usb-i2c-sl018/heartbeat.c
parentremoved rfid reader led (delay) (diff)
lowpass filterd manual switch
git-svn-id: https://svn.spreadspace.org/avr/trunk@167 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'usb-i2c-sl018/heartbeat.c')
-rw-r--r--usb-i2c-sl018/heartbeat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usb-i2c-sl018/heartbeat.c b/usb-i2c-sl018/heartbeat.c
index fd7f11a..47caffc 100644
--- a/usb-i2c-sl018/heartbeat.c
+++ b/usb-i2c-sl018/heartbeat.c
@@ -32,6 +32,10 @@
uint8_t heartbeat_cnt = 0;
uint8_t heartbeat_flag;
+#define FASTBEAT_PORT PORTD
+#define FASTBEAT_DDR DDRD
+#define FASTBEAT_BIT 5
+
// while running this gets called every ~10ms
ISR(TIMER0_COMPA_vect)
{
@@ -55,10 +59,14 @@ void init_heartbeat(void)
OCR0A = 155; // (1+155)*1024 = 159744 -> ~10 ms @ 16 MHz
TCNT2 = 0;
TIMSK0 = 1<<OCIE0A;
+
+ FASTBEAT_DDR |= 1<<FASTBEAT_BIT;
}
void heartbeat_task(void)
{
+ FASTBEAT_PORT ^= 1<<FASTBEAT_BIT;
+
if(heartbeat_flag)
led_on();
else