From 82f57f4b2d1307452ce840571b301b8317336c1e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 2 Jan 2016 15:05:07 +0100 Subject: firmware: add support for power/activity LEDs --- firmware/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/firmware/main.c b/firmware/main.c index 5a863e9..db5bf25 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -84,16 +84,17 @@ uchar i; usbDeviceConnect(); TCCR0 = 5; /* set prescaler to 1/1024 */ usbInit(); + PORTD = _BV(0); /* turn on power LED */ sei(); for(;;){ /* main event loop */ wdt_reset(); usbPoll(); if(TIFR & (1 << TOV0)){ TIFR |= 1 << TOV0; /* clear pending flag */ - /* - * a periodic (low-frequency, low-accuracy) loop function can - * be placed here. - */ + if (PINB & _BV(PB7)) + PORTD = _BV(0); /* SCL high : turn on power LED */ + else + PORTD = _BV(1); /* SCL low (busy) : turn on activity LED */ } } return 0; -- cgit v1.2.3