diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-02 15:05:07 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-02 15:05:16 +0100 |
commit | 82f57f4b2d1307452ce840571b301b8317336c1e (patch) | |
tree | 97d27b14fc294072bb39f808cb30e9e9f267ddb9 | |
parent | 255e3d2dddd5d41e37d061f93f0739990753e541 (diff) |
firmware: add support for power/activity LEDs
-rw-r--r-- | firmware/main.c | 9 |
1 files 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; |