Rev 1955 | Rev 1963 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1955 | Rev 1960 | ||
---|---|---|---|
Line 84... | Line 84... | ||
84 | // disable all interrupts before reconfiguration |
84 | // disable all interrupts before reconfiguration |
85 | cli(); |
85 | cli(); |
Line 86... | Line 86... | ||
86 | 86 | ||
Line 87... | Line 87... | ||
87 | // Configure speaker port as output. |
87 | // Configure speaker port as output. |
88 | 88 | ||
89 | if (BoardRelease == 10) { // Speaker at PD2 |
89 | if (boardRelease == 10) { // Speaker at PD2 |
90 | DDRD |= (1 << DDD2); |
90 | DDRD |= (1 << DDD2); |
91 | PORTD &= ~(1 << PORTD2); |
91 | PORTD &= ~(1 << PORTD2); |
92 | } else { // Speaker at PC7 |
92 | } else { // Speaker at PC7 |
Line 158... | Line 158... | ||
158 | 158 | ||
159 | // beeper on if duration is not over |
159 | // beeper on if duration is not over |
160 | if (beepTime) { |
160 | if (beepTime) { |
161 | beepTime--; // decrement BeepTime |
161 | beepTime--; // decrement BeepTime |
162 | if (beepTime & beepModulation) |
162 | if (beepTime & beepModulation) |
- | 163 | // beeper_On = 1; |
|
163 | beeper_On = 1; |
164 | beeper_On = 0; // shut up in dev!!! |
164 | else |
165 | else |
165 | beeper_On = 0; |
166 | beeper_On = 0; |
166 | } else { // beeper off if duration is over |
167 | } else { // beeper off if duration is over |
167 | beeper_On = 0; |
168 | beeper_On = 0; |
168 | beepModulation = BEEP_MODULATION_NONE; |
169 | beepModulation = BEEP_MODULATION_NONE; |
Line 169... | Line 170... | ||
169 | } |
170 | } |
170 | 171 | ||
171 | // if beeper is on |
172 | // if beeper is on |
172 | if (beeper_On) { |
173 | if (beeper_On) { |
173 | // set speaker port to high. |
174 | // set speaker port to high. |
174 | if (BoardRelease == 10) |
175 | if (boardRelease == 10) |
175 | PORTD |= (1 << PORTD2); // Speaker at PD2 |
176 | PORTD |= (1 << PORTD2); // Speaker at PD2 |
176 | else |
177 | else |
177 | PORTC |= (1 << PORTC7); // Speaker at PC7 |
178 | PORTC |= (1 << PORTC7); // Speaker at PC7 |
178 | } else { // beeper is off |
179 | } else { // beeper is off |
179 | // set speaker port to low |
180 | // set speaker port to low |
180 | if (BoardRelease == 10) |
181 | if (boardRelease == 10) |
181 | PORTD &= ~(1 << PORTD2);// Speaker at PD2 |
182 | PORTD &= ~(1 << PORTD2);// Speaker at PD2 |
182 | else |
183 | else |
Line 183... | Line 184... | ||
183 | PORTC &= ~(1 << PORTC7);// Speaker at PC7 |
184 | PORTC &= ~(1 << PORTC7);// Speaker at PC7 |
184 | } |
185 | } |
185 | 186 | ||
186 | #ifndef USE_NAVICTRL |
187 | #ifndef USE_NAVICTRL |
187 | // update compass value if this option is enabled in the settings |
188 | // update compass value if this option is enabled in the settings |
188 | if (staticParams.GlobalConfig & (CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE)) { |
189 | if (staticParams.bitConfig & (CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE)) { |
189 | #ifdef USE_MK3MAG |
190 | #ifdef USE_MK3MAG |
190 | MK3MAG_Update(); // read out mk3mag pwm |
191 | MK3MAG_Update(); // read out mk3mag pwm |
Line 214... | Line 215... | ||
214 | void delay_ms_Mess(uint16_t w) { |
215 | void delay_ms_Mess(uint16_t w) { |
215 | uint16_t t_stop; |
216 | uint16_t t_stop; |
216 | t_stop = setDelay(w); |
217 | t_stop = setDelay(w); |
217 | while (!checkDelay(t_stop)) { |
218 | while (!checkDelay(t_stop)) { |
218 | if (analogDataReady) { |
219 | if (analogDataReady) { |
219 | analogDataReady = 0; |
220 | analog_update(); |
220 | startAnalogConversionCycle(); |
221 | startAnalogConversionCycle(); |
221 | } |
222 | } |
222 | } |
223 | } |
223 | } |
224 | } |