X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=firmware%2Fgpio.c;h=d2a240b4e31fd4a3690ba4b69ace130b5dd83538;hp=d1efaaa0333315ac1a7e5d1e1cac91d6d1b2ff13;hb=a06ea914a745c95ca286ea41337ff5bbf3d02cbd;hpb=fad7e8ad13a9c01c6740331376ded53b7e085242 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) {