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=8e39bd29923359eb745946711bbb42a07bb21757;hb=HEAD;hpb=5ea15612762e0ed843fd31734b4937c15892b546 diff --git a/firmware/gpio.c b/firmware/gpio.c index 8e39bd2..b51d89f 100644 --- a/firmware/gpio.c +++ b/firmware/gpio.c @@ -2,24 +2,16 @@ #include "lights.h" -void gpio_init() +void init_gpio() { - 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)