Rev 2039 | Rev 2060 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2039 | Rev 2044 | ||
---|---|---|---|
Line 136... | Line 136... | ||
136 | /* Interrupt Routine of Timer 0 */ |
136 | /* Interrupt Routine of Timer 0 */ |
137 | /*****************************************************/ |
137 | /*****************************************************/ |
138 | ISR(TIMER0_OVF_vect) |
138 | ISR(TIMER0_OVF_vect) |
139 | { // 9765.625 Hz |
139 | { // 9765.625 Hz |
140 | static uint8_t cnt_1ms = 1, cnt = 0; |
140 | static uint8_t cnt_1ms = 1, cnt = 0; |
141 | uint8_t beeper_On = 0; |
141 | uint8_t beeperOn = 0; |
Line 142... | Line 142... | ||
142 | 142 | ||
143 | #ifdef USE_NAVICTRL |
143 | #ifdef USE_NAVICTRL |
144 | if(SendSPI) SendSPI--; // if SendSPI is 0, the transmit of a byte via SPI bus to and from The Navicontrol is done |
144 | if(SendSPI) SendSPI--; // if SendSPI is 0, the transmit of a byte via SPI bus to and from The Navicontrol is done |
Line 159... | Line 159... | ||
159 | 159 | ||
160 | // beeper on if duration is not over |
160 | // beeper on if duration is not over |
161 | if (beepTime) { |
161 | if (beepTime) { |
162 | beepTime--; // decrement BeepTime |
162 | beepTime--; // decrement BeepTime |
163 | if (beepTime & beepModulation) |
163 | if (beepTime & beepModulation) |
164 | // beeper_On = 1; |
- | |
165 | beeper_On = 1; // shut up in dev!!! |
164 | beeperOn = 1; |
166 | else |
165 | else |
167 | beeper_On = 0; |
166 | beeperOn = 0; |
168 | } else { // beeper off if duration is over |
167 | } else { // beeper off if duration is over |
169 | beeper_On = 0; |
168 | beeperOn = 0; |
170 | beepModulation = BEEP_MODULATION_NONE; |
169 | beepModulation = BEEP_MODULATION_NONE; |
Line 171... | Line 170... | ||
171 | } |
170 | } |
172 | 171 | ||
173 | if (beeper_On) { |
172 | if (beeperOn) { |
174 | // set speaker port to high. |
173 | // set speaker port to high. |
175 | if (boardRelease == 10) |
174 | if (boardRelease == 10) |
176 | PORTD |= (1 << PORTD2); // Speaker at PD2 |
175 | PORTD |= (1 << PORTD2); // Speaker at PD2 |
Line 182... | Line 181... | ||
182 | PORTD &= ~(1 << PORTD2);// Speaker at PD2 |
181 | PORTD &= ~(1 << PORTD2);// Speaker at PD2 |
183 | else |
182 | else |
184 | PORTC &= ~(1 << PORTC7);// Speaker at PC7 |
183 | PORTC &= ~(1 << PORTC7);// Speaker at PC7 |
185 | } |
184 | } |
Line 186... | Line 185... | ||
186 | 185 | ||
187 | #ifndef USE_NAVICTRL |
186 | #ifdef USE_DIRECT_GPS |
188 | // update compass value if this option is enabled in the settings |
187 | // update compass value if this option is enabled in the settings |
189 | if (staticParams.bitConfig & (CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE)) { |
- | |
190 | #ifdef USE_DIRECT_GPS |
188 | if (staticParams.bitConfig & (CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE)) { |
191 | MK3MAG_periodicTask(); // read out mk3mag pwm |
189 | MK3MAG_periodicTask(); // read out mk3mag pwm |
192 | #endif |
190 | #endif |
193 | } |
- | |
194 | #endif |
191 | } |
Line 195... | Line 192... | ||
195 | } |
192 | } |
196 | 193 | ||
197 | // ----------------------------------------------------------------------- |
194 | // ----------------------------------------------------------------------- |