]> www.fi.muni.cz Git - bike-lights.git/commitdiff
gpio: suspend function, status poweroff led
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sun, 30 Sep 2012 20:22:10 +0000 (22:22 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sun, 30 Sep 2012 20:22:10 +0000 (22:22 +0200)
firmware/gpio.c

index d1efaaa0333315ac1a7e5d1e1cac91d6d1b2ff13..d2a240b4e31fd4a3690ba4b69ace130b5dd83538 100644 (file)
@@ -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) {