firmware/bell.c
void start_audio(uint16_t sample_rate) {
	/* Stop interrupts momentarily */
	if (pwm_on) {
		/* We already have PWM running??? */
		RED_LED_PORT |= RED_LED_PIN;
		GREEN_LED_PORT &= ~GREEN_LED_PIN;
		BLUE_LED_PORT &= ~BLUE_LED_PIN;
		while(1);
	}
	cli();
	/* Set up buffer pointers */
	buffer_sel	= 1;
	buffer_ptr	= BUFFER_SZ-1;
	/* Set up timer 0 */
	OCR0A 	= UINT8_MAX/2;
	TCCR0A	= TCCR0A_VAL;
	TCCR0B	= TCCR0B_VAL;
	/* Set up timer 3 */
	OCR3A	= OCR3A_VAL(sample_rate);
	TCCR3A	= TCCR3A_VAL;
	TCCR3B	= TCCR3B_VAL;
	TIMSK3	= TIMSK3_VAL;
	/* Resume interrupts */
	sei();
	/* Wait for audio interrupt to tick */
	//led_colour 	= 0xc;
	while(!pwm_on);
}
/* Audio set-up routine, buffer 0 better be ready! */
Audio set-up routine, buffer 0 better be ready!
Audio set - up routine buffer 0 better be ready!
void start_audio(uint16_t sample_rate) {
	if (pwm_on) {
		RED_LED_PORT |= RED_LED_PIN;
		GREEN_LED_PORT &= ~GREEN_LED_PIN;
		BLUE_LED_PORT &= ~BLUE_LED_PIN;
		while(1);
	}
	cli();
	buffer_sel	= 1;
	buffer_ptr	= BUFFER_SZ-1;
	OCR0A 	= UINT8_MAX/2;
	TCCR0A	= TCCR0A_VAL;
	TCCR0B	= TCCR0B_VAL;
	OCR3A	= OCR3A_VAL(sample_rate);
	TCCR3A	= TCCR3A_VAL;
	TCCR3B	= TCCR3B_VAL;
	TIMSK3	= TIMSK3_VAL;
	sei();
	while(!pwm_on);
}
void start_audio ( uint16_t sample_rate ) { if ( pwm_on ) { RED_LED_PORT |= RED_LED_PIN ; GREEN_LED_PORT &= ~ GREEN_LED_PIN ; BLUE_LED_PORT &= ~ BLUE_LED_PIN ; while ( 1 ) ; } cli ( ) ; buffer_sel = 1 ; buffer_ptr = BUFFER_SZ - 1 ; OCR0A = UINT8_MAX / 2 ; TCCR0A = TCCR0A_VAL ; TCCR0B = TCCR0B_VAL ; OCR3A = OCR3A_VAL ( sample_rate ) ; TCCR3A = TCCR3A_VAL ; TCCR3B = TCCR3B_VAL ; TIMSK3 = TIMSK3_VAL ; sei ( ) ; while ( ! pwm_on ) ; }
Audio set-up routine, buffer 0 better be ready!
Audio set - up routine buffer 0 better be ready!
/* Stop interrupts momentarily */ /* We already have PWM running??? */ /* Set up buffer pointers */ /* Set up timer 0 */ /* Set up timer 3 */ /* Resume interrupts */ /* Wait for audio interrupt to tick */ //led_colour 	= 0xc;