From: Jan "Yenya" Kasprzak Date: Sun, 30 Sep 2012 20:22:10 +0000 (+0200) Subject: gpio: suspend function, status poweroff led X-Git-Tag: gerber-fab-20121029-1711~28 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=a06ea914a745c95ca286ea41337ff5bbf3d02cbd;p=bike-lights.git gpio: suspend function, status poweroff led --- diff --git a/firmware/gpio.c b/firmware/gpio.c index d1efaaa..d2a240b 100644 --- a/firmware/gpio.c +++ b/firmware/gpio.c @@ -13,6 +13,21 @@ void gpio_init() gpio_set(1, 1); } +void susp_gpio() +{ + DDRB &= ~(_BV(PB0) | _BV(PB2)); // LED4, LED5 + PORTB &=~ (_BV(PB0) | _BV(PB2)); + + DDRA &= ~(_BV(PA3) | _BV(PA4)); // LED6, LED7 + PORTA &=~ (_BV(PA3) | _BV(PA4)); +} + +void gpio_before_poweroff() +{ + DDRA |= _BV(PA4); + PORTA |= _BV(PA4); +} + void gpio_set(unsigned char n, unsigned char on) { if (on) {