X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=gpio.c;fp=gpio.c;h=0000000000000000000000000000000000000000;hb=f956c1fa7f47b0e8b8afe323c2eff1b6c2607c2a;hp=2ee32109d754360434afc6ec0ed3d5c3a8269592;hpb=f7cba12a75f10da7267c2e4d4488bb5ccddbb9d9;p=bike-lights.git diff --git a/gpio.c b/gpio.c deleted file mode 100644 index 2ee3210..0000000 --- a/gpio.c +++ /dev/null @@ -1,27 +0,0 @@ -#include - -#include "lights.h" - -void gpio_init() -{ - DDRB |= _BV(PB2) | _BV(PB4); - PORTB &=~ (_BV(PB2) | _BV(PB4)); - - gpio_set(GPIO_LED2, 1); -} - -void gpio_set(unsigned char n, unsigned char on) -{ - unsigned char bits = 0; - switch(n) { - case GPIO_LED1: bits = _BV(PB4); break; - case GPIO_LED2: bits = _BV(PB2); break; - } - - if (on) { - PORTB |= bits; - } else { - PORTB &= ~bits; - } -} -