diff --git a/fw_test/main.c b/fw_test/main.c index ddf33f6..ad5ea7e 100644 --- a/fw_test/main.c +++ b/fw_test/main.c @@ -12,55 +12,57 @@ -void init_leds(void){ +static void init_leds(void){ //enable LED channels as output DDRC |= (1 << PORTC0) | (1 << PORTC1) | (1 << PORTC2) | (1 << PORTC3); // both LEDs off PORTC &= ~((1 << PORTC0) | (1 << PORTC1) | (1 << PORTC2) | (1 << PORTC3)); return; -}; +} -void inline led_on(int leds){ +static void inline led_on(int leds){ PORTC |= leds; -}; +} -void inline led_off(int leds){ +static void inline led_off(int leds){ PORTC &= ~leds; -}; + return; +} +static void inline buzzr_off(){ + PORTC &= ~(1 << PORTC5); + PORTB &= ~(1 << PORTB2); +} - -void init_buzzr(){ +static void init_buzzr(void){ //its on B2 and C5, for reasons DDRC |= (1 << PORTC5); DDRB |= (1 << PORTB2); //switch it off buzzr_off(); return; -}; +} -void buzzr_up(){ +static void buzzr_up(void){ PORTC &= ~(1 << PORTC5); PORTB |= (1 << PORTB2); return; -}; +} -void buzzr_down(){ +static void buzzr_down(){ PORTC |= (1 << PORTC5); PORTB &= ~(1 << PORTB2); -}; +} -void inline buzzr_off(){ - PORTC &= ~(1 << PORTC5); - PORTB &= ~(1 << PORTB2); -}; -void buzzr_inv(){ + + +static void buzzr_inv(){ PORTC ^= (1 << PORTC5); PORTB ^= (1 << PORTB2); -}; +} -void init_motor(void) +static void init_motor(void) { /* vibration motor on B1, initially off: */ DDRB |= (1 << PORTB1); @@ -68,18 +70,19 @@ void init_motor(void) return; } -void set_motor(int val){ +static void set_motor(int val){ PORTB = ~(val); PORTB = PORTB; return; -}; +} -void init_switch(void){ +static void init_switch(void){ + DDRD &= ~( (1 << PORTD1) | (1<