X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=firmware%2Fgpio.c;h=d2a240b4e31fd4a3690ba4b69ace130b5dd83538;hb=a06ea914a745c95ca286ea41337ff5bbf3d02cbd;hp=d759b1883f114d2ed9fbae96a8e016ac4b689ca5;hpb=04c70055063c30c7ebda95872527919f5f48c9a2;p=bike-lights.git diff --git a/firmware/gpio.c b/firmware/gpio.c index d759b18..d2a240b 100644 --- a/firmware/gpio.c +++ b/firmware/gpio.c @@ -8,11 +8,26 @@ void gpio_init() PORTB &=~ (_BV(PB0) | _BV(PB2)); DDRA |= _BV(PA3) | _BV(PA4); // LED6, LED7 - PORTB &=~ (_BV(PA3) | _BV(PA4)); + PORTA &=~ (_BV(PA3) | _BV(PA4)); 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) {