X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=firmware%2Fbuttons.c;h=d0cbd51b10c5d2bff3ef35e85abc315d2f099907;hp=9a4c7e1172dfd52f1374969148f74945e3dc92bb;hb=5ea15612762e0ed843fd31734b4937c15892b546;hpb=740d6851a8c6110d3d37a5be59c9944f01fb92b0 diff --git a/firmware/buttons.c b/firmware/buttons.c index 9a4c7e1..d0cbd51 100644 --- a/firmware/buttons.c +++ b/firmware/buttons.c @@ -13,8 +13,8 @@ void init_buttons() { unsigned char i; - DDRB &= ~(_BV(PB4) | _BV(PB6)); - PORTB |= _BV(PB4) | _BV(PB6); + DDRA &= ~(_BV(PA3) | _BV(PA4)); + PORTA |= _BV(PA3) | _BV(PA4); for (i=0; i < N_BUTTONS; i++) { button_start[i] = 0; @@ -23,7 +23,7 @@ void init_buttons() just_waked_up = 1; - // log_byte(PORTB); + // log_byte(PORTA); } static void do_sleep() @@ -34,7 +34,7 @@ static void do_sleep() hw_suspend(); gpio_before_poweroff(); // Set the status LED on again - while((PINB & _BV(PB6)) == 0) + while((PINA & _BV(PA3)) == 0) ; // wait for button release _delay_ms(100); @@ -58,11 +58,11 @@ static void inline short_press(unsigned char n) void timer_check_buttons() { - unsigned char pinb = PINB; + unsigned char pin = PINA; unsigned char i; unsigned char port_states[N_BUTTONS] = { - pinb & _BV(PB6), - pinb & _BV(PB4), + pin & _BV(PA3), + pin & _BV(PA4), }; for (i = 0; i < N_BUTTONS; i++) {