Some more optimizations on AUDIO. AUDIO option set to false by default.

This commit is contained in:
bsongis
2012-01-30 18:42:14 +00:00
parent 3c8475636c
commit 74e454cd0b
6 changed files with 55 additions and 65 deletions
+20 -1
View File
@@ -166,6 +166,25 @@ void audioDefevent(uint8_t e);
#define AUDIO_MIX_WARNING_1() audioDefevent(AU_MIX_WARNING_1)
#define AUDIO_MIX_WARNING_3() audioDefevent(AU_MIX_WARNING_3)
#define AUDIO_HEARTBEAT() audio.heartbeat()
#if defined(PCBSTD)
#define AUDIO_HEARTBEAT() \
if (audio.toneTimeLeft > 0) { \
static uint8_t toneCounter; \
toneCounter += audio.toneFreq; \
if ((toneCounter & 0x80) == 0x80) \
PORTE |= (1 << OUT_E_BUZZER); \
else \
PORTE &= ~(1 << OUT_E_BUZZER); \
} \
static uint8_t cnt10ms = 77; \
if (cnt10ms-- == 0) \
cnt10ms = 77; \
else \
return; \
audio.heartbeat()
#else
#define AUDIO_HEARTBEAT() \
audio.heartbeat()
#endif
#endif // audio_h