Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 711 → Rev 712

/branches/V0.68d Code Redesign killagreg/timer0.c
27,7 → 27,19
// disable all interrupts before reconfiguration
cli();
 
// set PB3 and PB4 as output for the PWM
// configure speaker port as output
if(BoardRelease == 10)
{ // Speaker at PD2
DDRD |= (1<<DDD2);
PORTD &= ~(1<<PORTD2);
}
else
{ // Speaker at PC7
DDRC |= (1<<DDC7);
PORTC &= ~(1<<PORTC7);
}
 
// set PB3 and PB4 as output for the PWM used as aoffset for the pressure sensor
DDRB |= (1<<DDB4)|(1<<DDB3);
PORTB &= ~((1<<PORTB4)|(1<<PORTB3));
 
113,20 → 125,20
if(Beeper_On)
{
// set speaker port to high
if(BoardRelease == 10) PORTD |= (1<<2); // Speaker at PD2
else PORTC |= (1<<7); // Speaker at PC7
if(BoardRelease == 10) PORTD |= (1<<PORTD2); // Speaker at PD2
else PORTC |= (1<<PORTC7); // Speaker at PC7
}
else // beeper is off
{
// set speaker port to low
if(BoardRelease == 10) PORTD &= ~(1<<PORTD2);// Speaker at PD2
else PORTC &= ~(1<<PORTC7);// Speaker at PC7
else PORTC &= ~(1<<PORTC7);// Speaker at PC7
}
 
// update compass value if this option is enabled in the settings
if(ParamSet.GlobalConfig & CFG_COMPASS_ACTIVE)
{
MM3_timer0();
MM3_timer0(); // read out mm3 board
}
}