diff --git a/src/beeper.cpp b/src/beeper.cpp index 06b220f0a..fb649455f 100644 --- a/src/beeper.cpp +++ b/src/beeper.cpp @@ -55,6 +55,7 @@ static const pm_uint8_t beepTab[] PROGMEM = { void beep(uint8_t val) { + checkFlashOnBeep(); if (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && val!=0) || (g_eeGeneral.beeperMode==-1 && val>=3)) { _beep(pgm_read_byte(beepTab+5*(2+g_eeGeneral.beeperLength)+val)); } diff --git a/src/open9x.cpp b/src/open9x.cpp index bf03e9a36..5a0fefabe 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -1595,6 +1595,11 @@ char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE]; #define TIME_TO_WRITE s_eeDirtyMsk #endif +void checkFlashOnBeep() +{ + if(g_eeGeneral.flashBeep) g_LightOffCounter = FLASH_DURATION; +} + int32_t sum_chans512[NUM_CHNOUT] = {0}; void perMain() { @@ -1824,19 +1829,14 @@ void perMain() if(s_timerVal[0]==20) AUDIO_TIMER_20(); //beep two times if(s_timerVal[0]==10) AUDIO_TIMER_10(); if(s_timerVal[0]<= 3) AUDIO_TIMER_LT3(); - - if(g_eeGeneral.flashBeep && (s_timerVal[0]==30 || s_timerVal[0]==20 || s_timerVal[0]==10 || s_timerVal[0]<=3)) - g_LightOffCounter = FLASH_DURATION; } if (g_eeGeneral.minuteBeep && (((g_model.timers[0].val ? g_model.timers[0].val-s_timerVal[0] : s_timerVal[0])%60)==0)) { // short beep every minute AUDIO_MINUTE_BEEP(); - if(g_eeGeneral.flashBeep) g_LightOffCounter = FLASH_DURATION; } } else if(s_timerState[0] == TMR_BEEPING) { AUDIO_WARNING1(); - if(g_eeGeneral.flashBeep) g_LightOffCounter = FLASH_DURATION; } last_tmr = s_timerVal[0]; } @@ -1966,7 +1966,6 @@ void perMain() s_batCheck+=32; if (s_batCheck==0 && g_vbat100mV50) { AUDIO_ERROR(); - if (g_eeGeneral.flashBeep) g_LightOffCounter = FLASH_DURATION; } } break; diff --git a/src/open9x.h b/src/open9x.h index b0257af75..2b5e7f4a5 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -829,5 +829,7 @@ union ReusableBuffer extern union ReusableBuffer reusableBuffer; +void checkFlashOnBeep(); + #endif // gruvin9x_h /*eof*/