File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -150,12 +150,12 @@ ISR( TIMER2_OVF_vect ) //wakes up each second
150
150
151
151
ISR ( TIMER0_COMPA_vect ) //notes driver (second octave)
152
152
{
153
- PINC = _BV ( SPEAKER_N ) | _BV ( SPEAKER_P ); //toggle outputs
153
+ Speaker_Toggle ();
154
154
}
155
155
156
156
ISR ( TIMER0_COMPB_vect ) //notes driver (second octave)
157
157
{
158
- PINC = _BV ( SPEAKER_N ) | _BV ( SPEAKER_P ); //toggle outputs
158
+ Speaker_Toggle ();
159
159
}
160
160
161
161
// ADC interrupt service routine
Original file line number Diff line number Diff line change @@ -234,6 +234,11 @@ inline void Speaker_Off()
234
234
PORTC &= ~(_BV (SPEAKER_N ) | _BV (SPEAKER_P ));
235
235
}
236
236
237
+ inline void Speaker_Toggle ()
238
+ {
239
+ PINC = _BV (SPEAKER_N ) | _BV (SPEAKER_P ); //toggle outputs
240
+ }
241
+
237
242
inline void Speaker_Freq (uint8_t note )
238
243
{
239
244
OCR0A = note ;
You can’t perform that action at this time.
0 commit comments