This commit is contained in:
john stone 2012-09-25 07:23:14 +02:00
parent c711fb6a5b
commit 0bab67cc02

View File

@ -29,7 +29,7 @@ static void inline led_off(int leds){
return; return;
} }
static void inline buzzr_off(){ static void inline buzzr_off(void){
PORTC &= ~(1 << PORTC5); PORTC &= ~(1 << PORTC5);
PORTB &= ~(1 << PORTB2); PORTB &= ~(1 << PORTB2);
} }
@ -49,14 +49,14 @@ static void buzzr_up(void){
return; return;
} }
static void buzzr_down(){ static void buzzr_down(void){
PORTC |= (1 << PORTC5); PORTC |= (1 << PORTC5);
PORTB &= ~(1 << PORTB2); PORTB &= ~(1 << PORTB2);
} }
static void buzzr_inv(){ static void buzzr_inv(void){
PORTC ^= (1 << PORTC5); PORTC ^= (1 << PORTC5);
PORTB ^= (1 << PORTB2); PORTB ^= (1 << PORTB2);
} }
@ -78,7 +78,7 @@ static void set_motor(int val){
static void init_switch(void){ static void init_switch(void){
DDRD &= ~( (1 << PORTD1) | (1<<PORTD0)) DDRD &= ~( (1 << PORTD1) | (1<<PORTD0));
return; return;
} }
@ -136,8 +136,7 @@ static void mode_beeptest(void)
return; return;
} }
void __attribute__((noreturn)) int main(void)
main(void)
{ {
/* hardware initialisation: */ /* hardware initialisation: */
@ -161,7 +160,7 @@ main(void)
break; break;
case 3: case 3:
mode_beeptest(); mode_beeptest();
break(); break;
case 4: case 4:
default: default:
mode=0; mode=0;
@ -172,17 +171,19 @@ main(void)
switch( PIND & 3){ switch( PIND & 3){
case 1: case 1:
mode++ mode++;
break; break;
case 2: case 2:
mode --; mode --;
break; break;
case 3: case 3:
default: default:
;
} }
} }
/* never return 0; */ /* never return 0; */
return 0;
} }