From 88f4f84d93390e224b7c70a7af349fd905ce364c Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 18 Jul 2010 23:50:42 +0200 Subject: src/common/led: add pull-up --- src/common/led.c | 9 ++++++++- src/common/led.h | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/led.c b/src/common/led.c index dd01653..194e20e 100644 --- a/src/common/led.c +++ b/src/common/led.c @@ -55,6 +55,13 @@ struct led_t led_tab[] = { 0b101000, 0b100000 }, /* H3 */ }; +void +led_init (void) +{ + /* Activate pull-up. */ + PORTB |= LED_MASK; +} + void led_display (uint16_t leds, uint16_t duration) { @@ -76,7 +83,7 @@ led_display (uint16_t leds, uint16_t duration) utils_delay_ms (LED_UP_MS); /* Turn off, leds are too bright. */ DDRB = ddrb; - PORTB = portb; + PORTB = portb | LED_MASK; utils_delay_ms (LED_DOWN_MS); } } diff --git a/src/common/led.h b/src/common/led.h index e9bb1b3..e6ce0d0 100644 --- a/src/common/led.h +++ b/src/common/led.h @@ -24,6 +24,10 @@ * Email: * }}} */ +/** Initialise leds. */ +void +led_init (void); + /** Display a binary number on leds during a duration (1 = 5 ms). */ void led_display (uint16_t leds, uint16_t duration); -- cgit v1.2.3