@ -108,19 +108,19 @@ void ProcessNextSample(void)
# if defined(AUDIO_OUT_MONO)
# if defined(AUDIO_OUT_MONO)
/* Load the sample into the PWM timer channel */
/* Load the sample into the PWM timer channel */
OCR x A = ( ( uint8_t ) MixedSample_8Bit ^ ( 1 < < 7 ) ) ;
OCR 3 A = ( ( uint8_t ) MixedSample_8Bit ^ ( 1 < < 7 ) ) ;
# elif defined(AUDIO_OUT_STEREO)
# elif defined(AUDIO_OUT_STEREO)
/* Load the dual 8-bit samples into the PWM timer channels */
/* Load the dual 8-bit samples into the PWM timer channels */
OCR x A = ( ( uint8_t ) LeftSample_8Bit ^ ( 1 < < 7 ) ) ;
OCR 3 A = ( ( uint8_t ) LeftSample_8Bit ^ ( 1 < < 7 ) ) ;
OCR x B = ( ( uint8_t ) RightSample_8Bit ^ ( 1 < < 7 ) ) ;
OCR 3 B = ( ( uint8_t ) RightSample_8Bit ^ ( 1 < < 7 ) ) ;
# elif defined(AUDIO_OUT_PORTC)
# elif defined(AUDIO_OUT_PORTC)
/* Load the 8-bit mixed sample into PORTC */
PORTC = MixedSample_8Bit ;
PORTC = MixedSample_8Bit ;
# else
# else
uint8_t LEDMask = LEDS_NO_LEDS ;
uint8_t LEDMask = LEDS_NO_LEDS ;
/* Make mixed sample value positive (absolute) */
/* Make mixed sample value positive (absolute) */
if ( MixedSample_8Bit < 0 )
MixedSample_8Bit = abs ( MixedSample_8Bit ) ;
MixedSample_8Bit = - MixedSample_8Bit ;
if ( MixedSample_8Bit > ( ( 128 / 8 ) * 1 ) )
if ( MixedSample_8Bit > ( ( 128 / 8 ) * 1 ) )
LEDMask | = LEDS_LED1 ;
LEDMask | = LEDS_LED1 ;
@ -162,9 +162,9 @@ void EVENT_USB_Connect(void)
# if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))
# if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))
/* PWM speaker timer initialization */
/* PWM speaker timer initialization */
TCCR xA = ( ( 1 < < WGMx0 ) | ( 1 < < COMxA1 ) | ( 1 < < COMx A0)
TCCR 3A = ( ( 1 < < WGM30 ) | ( 1 < < COM3A1 ) | ( 1 < < COM3 A0)
| ( 1 < < COM xB1) | ( 1 < < COMx B0) ) ; // Set on match, clear on TOP
| ( 1 < < COM 3B1) | ( 1 < < COM3 B0) ) ; // Set on match, clear on TOP
TCCR xB = ( ( 1 < < WGMx2 ) | ( 1 < < CSx 0) ) ; // Fast 8-Bit PWM, Fcpu speed
TCCR 3B = ( ( 1 < < WGM32 ) | ( 1 < < CS3 0) ) ; // Fast 8-Bit PWM, Fcpu speed
# endif
# endif
}
}
@ -178,7 +178,7 @@ void EVENT_USB_Disconnect(void)
# if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))
# if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))
/* Stop the PWM generation timer */
/* Stop the PWM generation timer */
TCCR x B = 0 ;
TCCR 3 B = 0 ;
# endif
# endif
# if defined(AUDIO_OUT_MONO)
# if defined(AUDIO_OUT_MONO)