From e7e7a6ca97359ac2ad503cc79ae1076f283f225f Mon Sep 17 00:00:00 2001 From: bsongis Date: Thu, 16 Feb 2012 17:53:28 +0000 Subject: [PATCH] On stock board the Quiet mode was not working --- src/audio.cpp | 4 ++++ src/audio.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/audio.cpp b/src/audio.cpp index 71e6de1da..f0e995d88 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -114,7 +114,9 @@ inline uint8_t audioQueue::getToneLength(uint8_t tLen) } bool s_beeper; +#if defined(HAPTIC) bool s_haptic; +#endif void audioQueue::playNow(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tRepeat, uint8_t tHaptic, int8_t tFreqIncr) @@ -153,7 +155,9 @@ void audioQueue::playASAP(uint8_t tFreq, uint8_t tLen, uint8_t tPause, void audioQueue::event(uint8_t e, uint8_t f) { s_beeper = (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && e>AU_MENUS) || (g_eeGeneral.beeperMode>=-1 && e<=AU_ERROR)); +#if defined(HAPTIC) s_haptic = (g_eeGeneral.hapticMode>0 || (g_eeGeneral.hapticMode==0 && e>AU_MENUS) || (g_eeGeneral.hapticMode>=-1 && e<=AU_ERROR)); +#endif if (e < AU_FRSKY_FIRST || empty()) { switch (e) { diff --git a/src/audio.h b/src/audio.h index ff4bfabb0..d7cd3b576 100644 --- a/src/audio.h +++ b/src/audio.h @@ -140,7 +140,7 @@ class audioQueue } #elif defined(PCBSTD) inline void driver() { - if (toneTimeLeft > 0) { + if (toneFreq && toneTimeLeft > 0) { toneCounter += toneFreq; if ((toneCounter & 0x80) == 0x80) BUZZER_ON;