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;