From 1dc3de1bbcd220f0fd5e78bc2e60eebbebf07fd2 Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Fri, 30 Nov 2012 11:05:36 +0100 Subject: [PATCH] gpio: rework use correct swtiching between pin input and output (as per the datasheet, section 10.1.2), remove old logic of wakeup LED notifications --- firmware/gpio.c | 12 ++---------- firmware/lights.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/firmware/gpio.c b/firmware/gpio.c index 8e39bd2..69862e0 100644 --- a/firmware/gpio.c +++ b/firmware/gpio.c @@ -4,22 +4,14 @@ void gpio_init() { - DDRB |= _BV(PB0) | _BV(PB2) | _BV(PB4) | _BV(PB6); PORTB &=~ (_BV(PB0) | _BV(PB2) | _BV(PB4) | _BV(PB6)); - - gpio_set(1, 1); + DDRB |= _BV(PB0) | _BV(PB2) | _BV(PB4) | _BV(PB6); } void susp_gpio() { - DDRB &= ~(_BV(PB0) | _BV(PB2) | _BV(PB4) | _BV(PB6)); PORTB &= ~(_BV(PB0) | _BV(PB2) | _BV(PB4) | _BV(PB6)); -} - -void gpio_before_poweroff() -{ - DDRB |= _BV(PB2); - PORTB |= _BV(PB2); + DDRB |= _BV(PB0) | _BV(PB2) | _BV(PB4) | _BV(PB6); } void gpio_set(unsigned char n, unsigned char on) diff --git a/firmware/lights.h b/firmware/lights.h index 0f18a78..0850348 100644 --- a/firmware/lights.h +++ b/firmware/lights.h @@ -53,7 +53,6 @@ void pwmled_set_mode(unsigned char n, unsigned char mode); void gpio_init(); void susp_gpio(); void gpio_set(unsigned char n, unsigned char on); -void gpio_before_poweroff(); /* ambient.c */ void ambient_init(); -- 2.39.3