Audio was completely broken on v4. Now better, we hear sounds, but ridiculous sounds...

This commit is contained in:
bsongis
2012-01-27 20:53:11 +00:00
parent 7d511b1e13
commit dea8c79811
3 changed files with 30 additions and 18 deletions
+19 -5
View File
@@ -79,13 +79,27 @@ inline void AUDIO_HEARTBEAT()
if (beepOn) {
static bool warbleC;
warbleC = warble && !warbleC;
if (warbleC)
PORTE &= ~(1<<OUT_E_BUZZER);//buzzer off
else
PORTE |= (1<<OUT_E_BUZZER);//buzzer on
if (warbleC) {
#if defined(PCBV4)
TCCR0A &= ~(0b01<<COM0A0);
#else
PORTE &= ~(1 << OUT_E_BUZZER); // speaker output 'low'
#endif
}
else {
#if defined(PCBV4)
TCCR0A |= (0b01<<COM0A0); // tone on
#else
PORTE |= (1 << OUT_E_BUZZER); // speaker output 'high'
#endif
}
}
else {
PORTE &= ~(1<<OUT_E_BUZZER);
#if defined(PCBV4)
TCCR0A &= ~(0b01<<COM0A0);
#else
PORTE &= ~(1 << OUT_E_BUZZER); // speaker output 'low'
#endif
}
}