Subversion Repositories FlightCtrl

Rev

Rev 694 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 694 Rev 712
Line 25... Line 25...
25
        uint8_t sreg = SREG;
25
        uint8_t sreg = SREG;
Line 26... Line 26...
26
 
26
 
27
        // disable all interrupts before reconfiguration
27
        // disable all interrupts before reconfiguration
Line -... Line 28...
-
 
28
        cli();
-
 
29
 
-
 
30
        // configure speaker port as output
-
 
31
        if(BoardRelease == 10)
-
 
32
        {       // Speaker at PD2
-
 
33
                DDRD |= (1<<DDD2);
-
 
34
                PORTD &= ~(1<<PORTD2);
-
 
35
        }
-
 
36
        else
-
 
37
        {       // Speaker at PC7
-
 
38
                DDRC |= (1<<DDC7);
-
 
39
                PORTC &= ~(1<<PORTC7);
28
        cli();
40
        }
29
 
41
 
30
        // set PB3 and PB4 as output for the PWM
42
        // set PB3 and PB4 as output for the PWM used as aoffset for the pressure sensor
Line 31... Line 43...
31
        DDRB |= (1<<DDB4)|(1<<DDB3);
43
        DDRB |= (1<<DDB4)|(1<<DDB3);
32
        PORTB &= ~((1<<PORTB4)|(1<<PORTB3));
44
        PORTB &= ~((1<<PORTB4)|(1<<PORTB3));
Line 111... Line 123...
111
 
123
 
112
        // if beeper is on
124
        // if beeper is on
113
        if(Beeper_On)
125
        if(Beeper_On)
114
        {
126
        {
115
                // set speaker port to high
127
                // set speaker port to high
116
                if(BoardRelease == 10) PORTD |= (1<<2); // Speaker at PD2
128
                if(BoardRelease == 10) PORTD |= (1<<PORTD2); // Speaker at PD2
117
                else                      PORTC |= (1<<7); // Speaker at PC7
129
                else                   PORTC |= (1<<PORTC7); // Speaker at PC7
118
        }
130
        }
119
        else // beeper is off
131
        else // beeper is off
120
        {
132
        {
121
                // set speaker port to low
133
                // set speaker port to low
122
                if(BoardRelease == 10) PORTD &= ~(1<<PORTD2);// Speaker at PD2
134
                if(BoardRelease == 10) PORTD &= ~(1<<PORTD2);// Speaker at PD2
123
                else                      PORTC &= ~(1<<PORTC7);// Speaker at PC7
135
                else                   PORTC &= ~(1<<PORTC7);// Speaker at PC7
Line 124... Line 136...
124
        }
136
        }
125
 
137
 
126
        // update compass value if this option is enabled in the settings
138
        // update compass value if this option is enabled in the settings
127
        if(ParamSet.GlobalConfig & CFG_COMPASS_ACTIVE)
139
        if(ParamSet.GlobalConfig & CFG_COMPASS_ACTIVE)
128
        {
140
        {
129
                MM3_timer0();
141
                MM3_timer0(); // read out mm3 board