]> www.fi.muni.cz Git - bike-lights.git/commitdiff
buttons according to pins.txt
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 14 Sep 2012 21:01:20 +0000 (23:01 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 14 Sep 2012 21:01:20 +0000 (23:01 +0200)
firmware/buttons.c

index d5a18bec515ba2d7f3f17d645b923ffebe2e823b..84dd8da680a1019bfadd5f2992cb8e52f9068d86 100644 (file)
@@ -11,8 +11,8 @@ static unsigned char sleep_after_release;
 
 void init_buttons()
 {
-       DDRB &= ~(_BV(PB6) | _BV(PB0));
-       PORTB |= _BV(PB6) | _BV(PB0);
+       DDRB &= ~(_BV(PB4) | _BV(PB6));
+       PORTB |=  _BV(PB4) | _BV(PB6);
 
        sleep_after_release = 0;
        // log_byte(PORTB);
@@ -56,7 +56,7 @@ void timer_check_buttons()
        unsigned char i;
        unsigned char port_states[N_BUTTONS] = {
                pinb & _BV(PB6),
-               pinb & _BV(PB0),
+               pinb & _BV(PB4),
        };
        for (i = 0; i < N_BUTTONS; i++) {
                if (!port_states[i]) { // is pressed