From fcb678a11f769195c17e8fcb50e87e3401cc20b8 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 29 Feb 2012 07:36:05 +0000 Subject: [PATCH] Issue 4 solved (Beeps too long for MIX CENTER) --- src/audio.cpp | 6 +++--- src/audio.h | 1 + src/beeper.h | 1 + src/drivers.cpp | 2 +- src/open9x.cpp | 17 ----------------- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/audio.cpp b/src/audio.cpp index bb91e39f8..1901e8322 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -221,15 +221,15 @@ void audioQueue::event(uint8_t e, uint8_t f) break; // mix warning 1 case AU_MIX_WARNING_1: - playNow(BEEP_DEFAULT_FREQ + 50, 10, 1, 1, 1); + playNow(BEEP_DEFAULT_FREQ + 50, 6, 0, 0, 1); break; // mix warning 2 case AU_MIX_WARNING_2: - playNow(BEEP_DEFAULT_FREQ + 52, 10, 1, 2, 1); + playNow(BEEP_DEFAULT_FREQ + 52, 6, 0, 0, 1); break; // mix warning 3 case AU_MIX_WARNING_3: - playNow(BEEP_DEFAULT_FREQ + 54, 10, 1, 3, 1); + playNow(BEEP_DEFAULT_FREQ + 54, 6, 0, 0, 1); break; // time 30 seconds left case AU_TIMER_30: diff --git a/src/audio.h b/src/audio.h index 5a89ea02d..50bd72301 100644 --- a/src/audio.h +++ b/src/audio.h @@ -212,6 +212,7 @@ void audioDefevent(uint8_t e); #define AUDIO_MINUTE_BEEP() audioDefevent(AU_WARNING1) #define AUDIO_INACTIVITY() audioDefevent(AU_INACTIVITY) #define AUDIO_MIX_WARNING_1() audioDefevent(AU_MIX_WARNING_1) +#define AUDIO_MIX_WARNING_2() audioDefevent(AU_MIX_WARNING_2) #define AUDIO_MIX_WARNING_3() audioDefevent(AU_MIX_WARNING_3) #if defined(PCBSTD) diff --git a/src/beeper.h b/src/beeper.h index 69b69bb30..05e6a5f7b 100644 --- a/src/beeper.h +++ b/src/beeper.h @@ -60,6 +60,7 @@ extern void beep(uint8_t val); #define AUDIO_MINUTE_BEEP() beep(2) #define AUDIO_INACTIVITY() AUDIO_ERROR() #define AUDIO_MIX_WARNING_1() beep(1) +#define AUDIO_MIX_WARNING_2() beep(1) #define AUDIO_MIX_WARNING_3() beep(1) #define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn) diff --git a/src/drivers.cpp b/src/drivers.cpp index 6d027736e..e63ee8b0a 100644 --- a/src/drivers.cpp +++ b/src/drivers.cpp @@ -483,6 +483,6 @@ void per10ms() // These moved here from perOut() [gruvin9x.cpp] to improve beep trigger reliability. if(mixWarning & 1) if(((g_tmr10ms&0xFF)== 0)) AUDIO_MIX_WARNING_1(); - if(mixWarning & 2) if(((g_tmr10ms&0xFF)== 64) || ((g_tmr10ms&0xFF)== 72)) AUDIO_MIX_WARNING_1(); + if(mixWarning & 2) if(((g_tmr10ms&0xFF)== 64) || ((g_tmr10ms&0xFF)== 72)) AUDIO_MIX_WARNING_2(); if(mixWarning & 4) if(((g_tmr10ms&0xFF)==128) || ((g_tmr10ms&0xFF)==136) || ((g_tmr10ms&0xFF)==144)) AUDIO_MIX_WARNING_3(); } diff --git a/src/open9x.cpp b/src/open9x.cpp index 638af6d56..e047b0d58 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -1326,23 +1326,6 @@ void perOut(int16_t *chanOut, uint8_t phase) } } - //========== MIXER WARNING =============== - // 1,2 or 3 "bips" (short beeps) - //1= 00,08 - //2= 24,32,40 - //3= 56,64,72,80 - // Gruvin: Sometimes, one or more of these beeps do not fire. That will be because the tmr10ms counter - // may not necessarily be exactly (==) the below figures when queried from inside perOut(). - // But we only ever want a beep to fire once, so we have to use anexact counter match (not a range). - // My solution was to make mixWarning global and have the counter checks done inside per10ms(); - /* { - uint16_t tmr10ms ; - tmr10ms = get_tmr10ms() ; - if(mixWarning & 1) if(((tmr10ms&0xFF)== 0)) beepWarn1(); - if(mixWarning & 2) if(((tmr10ms&0xFF)== 64) || ((tmr10ms&0xFF)== 72)) beepWarn1(); - if(mixWarning & 4) if(((tmr10ms&0xFF)==128) || ((tmr10ms&0xFF)==136) || ((tmr10ms&0xFF)==144)) beepWarn1(); - } */ - //========== LIMITS =============== for (uint8_t i=0;i 1024*100