From 425cd52534478b4e3d1fc3a8bd3d2dc18e621509 Mon Sep 17 00:00:00 2001 From: Silent YANG Date: Sat, 20 Jan 2024 08:12:09 -0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=86=99=E9=A2=91=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E5=BC=80=E5=85=B3=E9=A6=96=E5=B0=BE=E9=9F=B3=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- driver/bk4819.c | 19 +++++++++++-------- settings.c | 3 ++- settings.h | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/driver/bk4819.c b/driver/bk4819.c index add3fe4..d45fa91 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -1759,8 +1759,12 @@ void BK4819_PrepareFSKReceive(void) #endif BK4819_EnterTxMute(); - AUDIO_AudioPathOn(); - BK4819_SetAF(BK4819_AF_BEEP); + if(gEeprom.MDC_AUDIO_LOCAL){ + AUDIO_AudioPathOn(); + BK4819_SetAF(BK4819_AF_BEEP); + }else{ + BK4819_SetAF(BK4819_AF_MUTE); + } BK4819_WriteRegister(BK4819_REG_70, BK4819_REG_70_ENABLE_TONE1 | (66u << BK4819_REG_70_SHIFT_TONE1_TUNING_GAIN)); @@ -2173,14 +2177,13 @@ void BK4819_enable_mdc1200_rx(const bool enable) // BK4819_REG_30_ENABLE_RX_DSP | 0); - #if 0 - GPIO_ClearBit(&GPIOC->DATA, 4); - BK4819_SetAF(BK4819_AF_MUTE); - #else - // let the user hear the FSK being sent + if(gEeprom.MDC_AUDIO_LOCAL){ BK4819_SetAF(BK4819_AF_BEEP); GPIO_SetBit(&GPIOC->DATA, 4); - #endif + }else{ + GPIO_ClearBit(&GPIOC->DATA, 4); + BK4819_SetAF(BK4819_AF_MUTE); + } // SYSTEM_DelayMs(2); // REG_51 diff --git a/settings.c b/settings.c index 26aae9c..1dbaa6f 100644 --- a/settings.c +++ b/settings.c @@ -124,15 +124,16 @@ void SETTINGS_InitEEPROM(void) gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 4) ? Data[7] : POWER_ON_DISPLAY_MODE_NONE; #endif -#ifdef ENABLE_CUSTOM_SIDEFUNCTIONS // 1FF8..1FFF EEPROM_ReadBuffer(0x1FF8, Data, 8); +#ifdef ENABLE_CUSTOM_SIDEFUNCTIONS gEeprom.KEY_M_LONG_PRESS_ACTION = (Data[0] < ACTION_OPT_LEN) ? Data[0] : ACTION_OPT_SWITCH_DEMODUL; gEeprom.KEY_1_SHORT_PRESS_ACTION = (Data[1] < ACTION_OPT_LEN-3) ? Data[1] : ACTION_OPT_MONITOR; gEeprom.KEY_1_LONG_PRESS_ACTION = (Data[2] < ACTION_OPT_LEN) ? Data[2] : ACTION_OPT_D_DCD; gEeprom.KEY_2_SHORT_PRESS_ACTION = (Data[3] < ACTION_OPT_LEN-3) ? Data[3] : ACTION_OPT_WIDTH; gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_FLASHLIGHT; #endif + gEeprom.MDC_AUDIO_LOCAL = Data[5]; // 0E98..0E9F EEPROM_ReadBuffer(0x0E98, Data, 8); diff --git a/settings.h b/settings.h index 31fdd6f..fedb01c 100644 --- a/settings.h +++ b/settings.h @@ -208,6 +208,7 @@ typedef struct { uint8_t KEY_2_SHORT_PRESS_ACTION; uint8_t KEY_2_LONG_PRESS_ACTION; #endif + uint8_t MDC_AUDIO_LOCAL; uint8_t MIC_SENSITIVITY; uint8_t MIC_SENSITIVITY_TUNING; uint8_t CHAN_1_CALL;