AUDIO now ok on v4

Code refactoring using a circular buffer for the queue: 212bytes flash saved, 7bytes ram saved, no more copy loops
This commit is contained in:
bsongis
2012-01-29 18:43:21 +00:00
parent 7617d25501
commit 52d4d5721b
4 changed files with 108 additions and 365 deletions
+2 -18
View File
@@ -79,30 +79,14 @@ inline void AUDIO_HEARTBEAT()
if (beepOn) {
static bool warbleC;
warbleC = warble && !warbleC;
if (warbleC) {
#if defined(PCBV4)
TCCR0A &= ~( 1 << COM0A0);
#else
if (warbleC)
PORTE &= ~(1 << OUT_E_BUZZER); // speaker output 'low'
#endif
}
else {
#if defined(PCBV4)
TCCR0A |= (1 << COM0A0); // tone on
#else
else
PORTE |= (1 << OUT_E_BUZZER); // speaker output 'high'
#endif
}
}
else {
#if defined(PCBV4)
TCCR0A &= ~(1 << COM0A0);
#else
PORTE &= ~(1 << OUT_E_BUZZER); // speaker output 'low'
#endif
}
}
#endif